Pre WordPress 3.3 only. Either add this CSS to your CSS file, add all the code to your functions.php file, or make a quick little plugin.
function fb_move_admin_bar() {
echo '
<style type="text/css">
body {
margin-top: -28px;
padding-bottom: 28px;
}
body.admin-bar #wphead {
padding-top: 0;
}
body.admin-bar #footer {
padding-bottom: 28px;
}
#wpadminbar {
top: auto !important;
bottom: 0;
}
#wpadminbar .quicklinks .menupop ul {
bottom: 28px;
}
</style>';
}
// on backend area
add_action( 'admin_head', 'fb_move_admin_bar' );
// on frontend area
add_action( 'wp_head', 'fb_move_admin_bar' );
Is there a way to only apply the css if the user is logged in? This seems to be overriding my css.
It is better to be used this way:
Because the if statement will fix the problem and it will add the action only when the admin bar is showing. (The answer to the question asked above)
I hope it helps! :x ;)
Could we maybe have a updated version of the code for WP 3.3 that would make the submenus of the bar work fine ? :)
I can verify that’s a problem. Unfortunately I don’t have the time to tinker with it. I’d be scared to anyway is it seems like the admin bar is changing a lot from version to version it might be a bunch of work that could get broken again quickly. Personally I just gave up and moved mine back to the top =/
Ok, no problem :)
I’ll maybe dig into it so :)
I managed to make it works with 3.3, you can grab the code from here : https://github.com/Axiol/WPStickAdminBarBottom
can it be only with a 40 px margin-top ? thank you
did it. ty
This worked for me in WP 3.5.1:
Works perfectly even on wp 4.2
Worked perfectly on WP 4.6. I only changed 28px to 32px. Thank you for code :)
This is fantastic- the admin bar at the top often drives me crazy when working on menus- much appreciated.
Is it possbile to let the menu of the toolbar pop out to the top?
I mean it´s nice to have it down there but you loose the possibility to use the drop down menu…
Pls help me :)