WordPress 3.1 Enable, Disable / Remove admin bar
WordPress 3.1 added new feature “WordPress admin Bar ” which adds admin bar to easily access wordpress backend features when you are logged in on your wordpress blog similar to wordpress.com blog.
Disable / Remove admin bar from wp-Admin
Each User can manage Enable/Disable admin bar from there profile page. Just login to your wordpress wp-admin and go to your profile page.
Just select where you want to display the admin bar “when viewing site” or “in dashboard“.
Disable / Remove WordPress 3.1 admin bar to all users
To disable / remove admin bar to all users add following lines of code inside your themes functions.php file
1234function
my_function_admin_bar(){
return
false;
}
add_filter(
'show_admin_bar'
,
'my_function_admin_bar'
);
WordPress 3.1 Disable / Remove admin bar to all users except Administrators.
1234function
my_function_admin_bar(
$content
) {
return
( current_user_can(
"administrator"
) ) ?
$content
: false;
}
add_filter(
'show_admin_bar'
,
'my_function_admin_bar'
);
thanks. that was helpful.
perfect solution. thanks so much!!!