WordPress.org

Ready to get started?Download WordPress

Forums

wp_head() in IE9 adding extra pixels (2 posts)

  1. hugovermaak
    Member
    Posted 3 years ago #

    This drove me nuts and I still don't know how to fix it. The wp_head() function causes IE9 to add 28px to the top of the page. How do I fix this?

    I went through a procces of elimination, uncomenting line by line, when I commented out <?php wp_head(); ?> the extra 28px went away.

    Here is the top part of my index.php:


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />

    <title>
    <?php if (function_exists('is_tag') && is_tag()) {
    single_tag_title('Tag Archive for "'); echo '" - ';
    } elseif (is_archive()) {
    wp_title(''); echo ' Archive - ';
    } elseif (is_search()) {
    echo 'Search for "'.wp_specialchars($s).'" - ';
    } elseif (!(is_404()) && (is_single()) || (is_page())) {
    wp_title(''); echo ' - ';
    } elseif (is_404()) {
    echo 'Not Found - ';
    }
    if (is_home()) {
    bloginfo('name'); echo ' - '; bloginfo('description');
    } else {
    bloginfo('name');
    }
    if ($paged > 1) {
    echo ' - page '. $paged;
    } ?>
    </title>

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    <link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/images/favicon.ico" />

    <?php wp_enqueue_script('jquery'); ?>
    <!--<?php wp_head(); ?>-->

    </head>

  2. Chase Adams
    Member
    Posted 2 years ago #

    The interesting thing is that the bit that's supposed to fill in this margin comes from footer.php, not the header.php. Do you have wp_footer() in the footer.php?

    I wrote a post on my website, Why Your WordPress Theme Has A Rogue 28 Pixel Margin On Top, that explains why it's there and how to fix it.

    Good luck!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags