Title: Using get_header or get_footer causes gap between #wrapper and body
Last modified: August 19, 2016

---

# Using get_header or get_footer causes gap between #wrapper and body

 *  Resolved [dguyen](https://wordpress.org/support/users/dguyen/)
 * (@dguyen)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/using/)
 * When creating my template if I include:
    **get_header or get_footer** I get a
   gap between my #wrapper and the top and bottom of the body page. If I remove 
   the tags and just include the code all within one template file, the problem 
   goes away…can someone please help?
 * I apologize but my build is local and I don’t have a link to it.
 * I remember reading somewhere about an issue with Multisite -which I may have 
   to break one of my divs from the header.php file into the template.php file?

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Person](https://wordpress.org/support/users/person/)
 * (@person)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/using/#post-1595163)
 * As far as I know, get_header and get_footer simply include the header.php and
   footer.php files, so there’s no reason why there should be an extra gap unless
   you’re adding extra code that you didn’t when you put everything in one file.
 *  [Andrea Rennick](https://wordpress.org/support/users/andrea_r/)
 * (@andrea_r)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/using/#post-1595166)
 * This shouldn’t have an issue with multisite at all.
 *  Thread Starter [dguyen](https://wordpress.org/support/users/dguyen/)
 * (@dguyen)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/using/#post-1595314)
 * Thank you so much for the replies…I’ve racked my brain for another hour or so…
   can’t figure it out. Here is the entire page.php template file below.
    All works
   fine when the browser calls this file…but if I cut out everything #main div and
   above and place it in the header.php file and cut everything #footer and below
   into footer.php (whilst making my get_header and get_footer calls) I get a gap.
   No errors.
 * I did notice nothing wrong when viewing the source, but inside Firebug, there
   are scripts/links from <head> showing up inside the <body> tag… which Firebug
   measures 14px in height…
 *     ```
       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
       <html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
       <head profile="http://gmpg.org/xfn/11">
       <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
       <title><?php wp_title('«', true, 'right'); ?> <?php bloginfo('name'); ?></title>
       <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
       <?php wp_enqueue_script('jquery'); ?>
       <?php wp_head(); ?>
       </head>
   
       <body <?php body_class(); ?>>
   
       	<div id="wrapper">
   
       		<div id="header">
   
       			<div id="badge"><a href=<?php bloginfo('home'); ?>>Logo</a></div>
   
       			<ul id="menu">
   
       				<li class="about_us"><a href="<?php bloginfo('url'); ?>/about">About Us</a></li>
       				<li class="how_it_works"><a href="#">How it Works</a></li>
       				<li class="contact_us"><a href="#">Contact Us</a></li>
       				<li class="sign_up"><a href="#">Sign Up</a></li>
   
       			</ul>
   
       			<br class="clearfix" />
   
       		</div><!-- end #header -->
   
       				<div id="page_quote" class="large_quote black">
       			“Never has design been more important”
       		</div>
   
       		<div id="main">
   
       			<div id="content">
   
       				<?php if (have_posts()) : ?>
   
       					<?php while (have_posts()) : the_post(); ?>
   
       						<div <?php post_class(); ?> id="post-<?php the_id(); ?>">
   
       							<h1><?php the_title(); ?></h1>
   
       							<?php the_content(); ?>
   
       						</div><!-- end of each .post -->
   
       					<?php endwhile; ?>
   
       				<?php else : ?>
   
       				<?php endif; ?>
   
       			</div><!-- end #content -->
   
       			<br class="clearfix" />
   
       		</div><!-- end #main -->
   
       		<div id="footer">
   
       			<div class="sub">
       				<p>All content are copyright of FAQsMe. All Right Reserved.</p>
       			</div>
   
       		</div><!-- end #footer -->
   
       	</div><!-- end #wrapper -->
   
       <?php wp_footer(); ?>
       </body>
   
       </html>
       ```
   
 * I must be completely dense? When comparing Firebug with the single page.php file
   vs. page.php (with get_header/get_footer) why are the link <head> links showing
   inside the <body> tags?
 *  Thread Starter [dguyen](https://wordpress.org/support/users/dguyen/)
 * (@dguyen)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/using/#post-1595365)
 * Alright, after some more deduction… I assume my extra padding between my `#wrapper`
   and the body is from the unusual placement of my `<head>` scripts/links inside
   of the `<body>` tags just before `#wrapper`. (ie. stylesheet, jQuery script, 
   EditURI, WLWmanifest -which Firebug says these links are 0x14px in size)
 * So the question is…
    Why are my `<head>` links/scripts finding their way inside
   the <body> tags when I use the `get_header` and `get_footer` calls?
 * … is someone going to tell me how blatantly blind I’m being? What am I missing?
 *  Thread Starter [dguyen](https://wordpress.org/support/users/dguyen/)
 * (@dguyen)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/using/#post-1595441)
 * I decided to copy and paste my code work into a new text document and for some
   reason everything is fine. Maybe there was an issue with my original document…
   ASCII, UTF-8, etc…?
 *  [Andy Brudtkuhl](https://wordpress.org/support/users/abrudtkuhl/)
 * (@abrudtkuhl)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/using/#post-1595495)
 * I am having this same issue however copy and paste into a new document didnt 
   work for m
 *  [apparentlyrich](https://wordpress.org/support/users/apparentlyrich/)
 * (@apparentlyrich)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/using/#post-1595496)
 * abrudtkuhl, I’m having the same issue also. Not really sure what’s wrong with
   the code as before I upgraded the the Nightly’s everything was working pretty
   well with no gap.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Using get_header or get_footer causes gap between #wrapper and body’ 
is closed to new replies.

## Tags

 * [get_footer](https://wordpress.org/support/topic-tag/get_footer/)
 * [get_header](https://wordpress.org/support/topic-tag/get_header/)
 * [template](https://wordpress.org/support/topic-tag/template/)

 * In: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
 * 7 replies
 * 5 participants
 * Last reply from: [apparentlyrich](https://wordpress.org/support/users/apparentlyrich/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/using/#post-1595496)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
