Skip to content

Instantly share code, notes, and snippets.

@wpbandit
Created March 2, 2012 15:47
Show Gist options
  • Save wpbandit/1959260 to your computer and use it in GitHub Desktop.
Save wpbandit/1959260 to your computer and use it in GitHub Desktop.
WP Move Admin Bar
<?php
// Add action to wp_head
add_action('wp_head','move_admin_bar_bottom');
// Move admin bar to bottom of page
function move_admin_bar_bottom() {
if(is_user_logged_in()) {
echo "
<style type='text/css'>
* html body { margin-top: 0 !important; }
body.admin-bar { margin-top: -28px; padding-bottom: 28px; }
body.wp-admin #footer { padding-bottom: 28px; }
#wpadminbar { top: auto !important; bottom: 0; }
#wpadminbar .quicklinks .ab-sub-wrapper { bottom: 28px; }
#wpadminbar .quicklinks .ab-sub-wrapper ul .ab-sub-wrapper { bottom: -7px; }
</style>
";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment