Forums

[resolved] Call to wp_head() breaks layout in IE (3 posts)

  1. karl53
    Member
    Posted 5 months ago #

    I've developed my first custom theme and it looks fine with one exception.

    In IE 8 (did't test other vers of IE yet) there is a 28 pixel gap at the top of the page. That is, the first row after the body tag is 28 pixels lower than what I would expect.

    If I comment out the call to wp_head(), the gap disappears.

    I notice these lines are added when I view my page source:

    >>>
    <meta name="generator" content="WordPress 3.3" />
    <style type="text/css" media="print">#wpadminbar { display:none; }</style>
    <style type="text/css" media="screen">
    html { margin-top: 28px !important; }
    * html body { margin-top: 28px !important; }

    </style>
    </head>
    >>>>

    How should I go about fixing this problem?

    TIA,
    Karl

  2. songdogtech
    Member
    Posted 5 months ago #

    That's from the wpadminbar. Disable that in your user profile. Or if you want it, some other CSS is preventing it from being displayed correctly in IE.

  3. karl53
    Member
    Posted 5 months ago #

    Thank you. That did the trick.

    For lurkers, I had to add this line to the theme's function file:

    add_action( 'show_admin_bar', '__return_false' );

Reply

You must log in to post.

About this Topic

Tags