Move the Admin Bar to the Bottom on the Front End
Pins the admin bar to the bottom of the screen on the front end, so it no longer covers sticky headers and menus while you browse your site.
Opens WPIDE on
Code
add_action( 'wp_head', function () {
if ( ! is_admin_bar_showing() ) {
return;
}
?>
<style id="wpide-admin-bar-bottom">
html { margin-top: 0 !important; }
body { margin-bottom: 32px; }
#wpadminbar { top: auto !important; bottom: 0; position: fixed; }
#wpadminbar .menupop .ab-sub-wrapper { bottom: 32px; }
@media screen and (max-width: 782px) {
body { margin-bottom: 46px; }
#wpadminbar .menupop .ab-sub-wrapper { bottom: 46px; }
}
</style>
<?php
}, 100 );
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.