WordPress.org

Ready to get started?Download WordPress

Forums

Extra white space above header in custom theme in Firefox (8 posts)

  1. MD84
    Member
    Posted 3 years ago #

    Hey,

    after turning my HTML file into a custom WordPress theme I found an extra white space above my header in Firefox (about 28px). The weird thing is that the extra white space doesn't appear in Safari (I haven't tested it on other browsers yet). Although I managed to remove the extra white space using a Gecko hack:

    body:-moz-last-node #wrapper{margin:-28px 0 0 0;}

    I am wondering what the problem is.

    Does anyone have an answer for me? Thanks

  2. If you provide a link to your site it'll be much easier to help. :-)

  3. billimarie
    Member
    Posted 3 years ago #

    Hi MD84,

    Try logging out and viewing your site. I noticed that Firefox seems to think there's an invisible admin bar up there, but when I log out of my dash the entire site looks normal--without the random margin-top space!

    -b

  4. mheltone
    Member
    Posted 3 years ago #

    Yep yep..
    If you logout, that white space will disappear.
    I think the <?php wp_head(); ?> is causing that.

    Just guessing...

  5. Snowyn
    Member
    Posted 3 years ago #

    Wow. Thanks -- this fixed the problem I was seeing. Weird thing, it was on only ONE of my templates! The index and "pagecontent" templates were fine while I was logged in. But the homepage template I made had 25px of blank space above both the #wrapper and the background image (placed at top position)! I was tearing my hair out... But when I logged out, that space disappeared. Definitely Firefox.

  6. Subhramani
    Member
    Posted 2 years ago #

    This helped me when I had the exact same issue. Its not an issue with Firefox. Happened with all browsers for me.

  7. theresalwaysaway
    Member
    Posted 2 years ago #

    Okay but obviously this is a problem with the admin bar not displaying with a specific theme which suggests the theme is actually buggy. So how do we fix that?

  8. theresalwaysaway
    Member
    Posted 2 years ago #

    I fixed my issue, in my case and many others there has to be a call to wp_footer() in the footer.php. In my case I added <?php wp_footer(); ?> right before I closed the body tag in the footer.php and it worked like a charm. I hope this helps you guys!

Topic Closed

This topic has been closed to new replies.

About this Topic