All PostsWordPress

If you are a WordPress user, you may have noticed with the latest update you get an admin bar display on your WordPress site when you are logged in. I actually find this rather annoying, but I can see the benefits, the extra admin menu bar allows you to easily jump into the WordPress admin area without fumbling around with multiple browser windows open.

The two code snippets below allow you to remove the WordPress admin bar from your site completely or remove it from all WordPress users except an admin, I found this to a great little feature, especially if you have multiple users.

Remove The WordPress Admin Bar Completely

1) Open your functions.php file found under ‘Appearence’ -> Editor -> functions.php

2) Insert the provided code into the top of your functions.php file below the PHP opening tags <?php

[php]
function my_function_admin_bar(){
return false;
}
add_filter( ‘show_admin_bar’ , ‘my_function_admin_bar’);
[/php]

Show the WordPress Admin Bar To Administrators Only

[php]
function my_function_admin_bar($content) {
return ( current_user_can(“administrator”) ) ? $content : false;
}
add_filter( ‘show_admin_bar’ , ‘my_function_admin_bar’);

[/php]

Remember to back up WordPress files before editing them, this is a great little code snippet I came accross, I hope it help you!