nSurface

Remove that stupid WordPress admin bar

Introduced with WordPress 3.0 (I think?), a little admin bar automatically appears at the top of your wordpress website whenever you’re logged it. While it may be useful for someone, it’s actually pretty annoying and really unsightly in most cases (it can also mess up your site if you have absolute or fixed position items in your theme). There are plugins to remove it, but I prefer to keep everything I can in my functions.php file to increase theme portability and stability. Paste this into your functions file:


//remove admin bar
add_action( 'admin_print_scripts-profile.php', 'hide_admin_bar_prefs' );
function hide_admin_bar_prefs() {
 echo '<style type="text/css">.show-admin-bar { display: none; }</style>';
}
add_filter( 'show_admin_bar', '__return_false' );

forget you ever saw that bar

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>