• Whenever I’m logged in and then going to browse the site, there’s a block of code injected into my wp_head():

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

    This causes a 28px gap to appear at the top of the page, but only when I’m logged in.

    Is there supposed to be an admin bar showing in that place? If so, how do I fix it? If not, how can I suppress the gap? it’s not a huge deal since only I see it, but it’s bugging me.

    occurs on this blog: https://www.thisdoesntsuckblog.com

Viewing 1 replies (of 1 total)
  • I am not sure right now, how to fix it a way, that the admin bar will be displayed where this gap is. I am pretty sure that this is caused by some plugin, or by an old theme. On my blog I had the same issue. I decided to fix it the other way around: REMOVE that gap – no admin bar at all. It might be a bit sloppy but here is how I did, having no problems anymore:

    In wordpress/wp-includes/admin-bar.php from line 381 to line 387 ->

    function _admin_bar_bump_cb() { ?>
    <style type="text/css" media="screen">
    	html { margin-top: 28px !important; }
    	* html body { margin-top: 28px !important; }
    </style>
    <?php
    }

    Change the values for margin-top to 0px here. That’s all!

    Hope that might help you and everyone having this issue.
    Best regards

Viewing 1 replies (of 1 total)
  • The topic ‘gap at top (no wpadminbar) when browsing site as logged in admin’ is closed to new replies.