• WordPress v3.3,
    Website: http://test.spartabots.co.cc

    The problem:
    When I upgraded to WordPress 3.3, the admin bar started mucking up some of my CSS. I think I’ve isolated the fact to how WordPress adds

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

    to each webpage.

    I’ve tried adding

    function fb_adjust_admin_bar() { ?>
    	<style type="text/css" media="screen">
    		html{
    			margin-top:0 !important;
    		}
    		* body body{
    			margin-top:0 !important;
    		}
    	</style> <?php
    }
    add_action( 'wp_head', 'fb_adjust_admin_bar' );
    '
    to functions.php, but now every webpage just displays

    <style type=”text/css” media=”screen”>
    html{ margin-top:0 !important; }
    * body body{ margin-top:0 !important; }
    </style>
    <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>`

    How do I fix this?

Viewing 1 replies (of 1 total)
  • Thread Starter Michael

    (@deflect)

    Sorry, I misposted slightly (and couldn’t find an edit feature).

    I meant to say, after trying adding

    function fb_adjust_admin_bar() { ?>
    	<style type="text/css" media="screen">
    		html{
    			margin-top:0 !important;
    		}
    		* body body{
    			margin-top:0 !important;
    		}
    	</style> <?php
    }
    add_action( 'wp_head', 'fb_adjust_admin_bar' );

    to functions.php, every webpage just displays

    <style type="text/css" media="screen">
    	html{ margin-top:0 !important; }
    	* body body{ margin-top:0 !important; }
    </style>
    <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>

    …and the lower style overrides the upper one.

    How do I fix this?

Viewing 1 replies (of 1 total)

The topic ‘Issues with admin bar’ is closed to new replies.