Created
October 6, 2017 12:57
-
-
Save aderaaij/80e44cd788c86e0fe3bbeada6111e820 to your computer and use it in GitHub Desktop.
Modify the admin bar position on the front-end to the bottom and add the proper styles for the dropdown menu.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function modify_admin_bar_position() { | |
if ( is_user_logged_in() ) { ?> | |
<style type="text/css"> | |
body { | |
margin-top: -32px; | |
padding-bottom: 32px; | |
} | |
body.admin-bar #wphead { | |
padding-top: 0; | |
} | |
body.admin-bar #footer { | |
padding-bottom: 32px; | |
} | |
#wpadminbar { | |
top: auto !important; | |
bottom: 0; | |
} | |
#wpadminbar .quicklinks .menupop ul { | |
/* bottom: 28px; */ | |
} | |
.ab-sub-wrapper { | |
bottom: 32px; | |
} | |
@media screen and (max-width: 782px) { | |
body { | |
margin-top: -46px; | |
padding-bottom: 46px; | |
} | |
.ab-sub-wrapper { | |
bottom: 46px; | |
} | |
} | |
</style> | |
<?php | |
} | |
} | |
add_action( 'wp_head', 'modify_admin_bar_position' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment