title: Should I place my navbar before or after the `<body>` tag when customizing a WP theme?
body: <p>I am customizing a WP theme by making a child theme. I am placing a navbar from Bootstrap into the header.php file in the child theme directory. However, I'm not sure where to place the navbar code. I can place it both before <em>and</em> after the <code>&lt;body&gt;</code> tag successfully (as in, the navbar shows up just fine no matter which one I pick), but I'd like to phone an experienced friend here and ask which is the better practice.</p>
  
  <p><strong>Original, unmodified header.php code</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html &lt;?php language_attributes(); ?&gt;&gt;
  &lt;head&gt;
      &lt;meta charset="&lt;?php bloginfo( 'charset' ); ?&gt;" /&gt;
      &lt;meta name="viewport" content="width=device-width" /&gt;
      &lt;title&gt;&lt;?php wp_title( ' | ', true, 'right' ); ?&gt;&lt;/title&gt;
      &lt;link rel="stylesheet" type="text/css" href="&lt;?php echo get_stylesheet_uri(); ?&gt;" /&gt;
      &lt;?php wp_head(); ?&gt;
  &lt;/head&gt;
  &lt;body &lt;?php body_class(); ?&gt; &gt;
      &lt;div id="wrapper" class="hfeed"&gt;
          &lt;header id="header" role="banner"&gt;
          &lt;section id="branding"&gt;
              &lt;div id="site-title"&gt;&lt;?php if ( ! is_singular() ) { echo '&lt;h1&gt;'; } ?&gt;&lt;a href="&lt;?php echo esc_url( home_url( '/' ) ); ?&gt;" title="&lt;?php esc_attr_e( get_bloginfo( 'name' ), 'blankslate' ); ?&gt;" rel="home"&gt;&lt;?php echo esc_html( get_bloginfo( 'name' ) ); ?&gt;&lt;/a&gt;&lt;?php if ( ! is_singular() ) { echo '&lt;/h1&gt;'; } ?&gt;&lt;/div&gt;
              &lt;div id="site-description"&gt;&lt;?php bloginfo( 'description' ); ?&gt;&lt;/div&gt;
          &lt;/section&gt;
          &lt;nav id="menu" role="navigation"&gt;
              &lt;div id="search"&gt;
                  &lt;?php get_search_form(); ?&gt;
              &lt;/div&gt;
              &lt;?php wp_nav_menu( array( 'theme_location' =&gt; 'main-menu' ) ); ?&gt;
          &lt;/nav&gt;
          &lt;/header&gt;
          &lt;div id="container"&gt;
  </code></pre>
  
  <p><strong>My navbar code will replace the <code>&lt;nav&gt;</code> section in the above code, like so</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html &lt;?php language_attributes(); ?&gt;&gt;
  
  &lt;head&gt;
      &lt;meta charset="&lt;?php bloginfo( 'charset' ); ?&gt;" /&gt;
      &lt;meta name="viewport" content="width=device-width, initial scale=1" /&gt;
      &lt;title&gt;&lt;?php wp_title( ' | ', true, 'right' ); ?&gt;&lt;/title&gt;
      &lt;link rel="stylesheet" type="text/css" href="&lt;?php echo get_stylesheet_uri(); ?&gt;" /&gt;
      &lt;?php wp_head(); ?&gt;
  
  &lt;/head&gt;
  
              &lt;nav class="navbar navbar-default"&gt;
                &lt;div class="container-fluid"&gt;
                  &lt;!-- Brand and toggle get grouped for better mobile display --&gt;
                  &lt;div class="navbar-header"&gt;
                    &lt;button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"&gt;
                      &lt;span class="sr-only"&gt;Toggle navigation&lt;/span&gt;
                      &lt;span class="icon-bar"&gt;&lt;/span&gt;
                      &lt;span class="icon-bar"&gt;&lt;/span&gt;
                      &lt;span class="icon-bar"&gt;&lt;/span&gt;
                    &lt;/button&gt;
                    &lt;a class="navbar-brand" href="&lt;?php echo esc_url( home_url( '/' ) ); ?&gt;"&gt;MoonLighting&lt;/a&gt;
                  &lt;/div&gt;
  
                  &lt;!-- Collect the nav links, forms, and other content for toggling --&gt;
                  &lt;div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"&gt;
                    &lt;ul class="nav navbar-nav navbar-right"&gt;
                      &lt;li&gt;&lt;a href="pages/adultanswers.php"&gt;Side Job&lt;/a&gt;&lt;/li&gt;
                      &lt;li class="dropdown"&gt;
                        &lt;a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"&gt;My Account &lt;span class="caret"&gt;&lt;/span&gt;&lt;/a&gt;
                        &lt;ul class="dropdown-menu"&gt;
                          &lt;li&gt;&lt;a href="#"&gt;Settings&lt;/a&gt;&lt;/li&gt;
                          &lt;li&gt;&lt;a href="#"&gt;Add Funds&lt;/a&gt;&lt;/li&gt;
                          &lt;li role="separator" class="divider"&gt;&lt;/li&gt;
                          &lt;li&gt;&lt;a href="#"&gt;Sign Out&lt;/a&gt;&lt;/li&gt;
                        &lt;/ul&gt;
                      &lt;/li&gt;
                    &lt;/ul&gt;
                  &lt;/div&gt;
  
                &lt;/div&gt;&lt;!-- /.container-fluid --&gt;
              &lt;/nav&gt;
  
  &lt;body &lt;?php body_class(); ?&gt;&gt;
      &lt;div id="wrapper" class="hfeed"&gt;
          &lt;header id="header" role="banner"&gt;
              &lt;section id="branding"&gt;
                  &lt;!--I removed this for reasons unrelated--&gt;
              &lt;/section&gt;
  </code></pre>