There are many ways to hide the management bar, and there are many reasons why you may want to hide the management bar. You can do this by adding some code in the theme's functions.php file
Disable the WordPress admin bar for all users
add_filter('show_admin_bar', '__return_false');
Disable the WordPress admin bar for specific user roles
function hide_admin_bar( $show) {
if (current_user_can('subscriber') || current_user_can('author')):
return false;
endif;
return $show;
}
add_filter('show_admin_bar','hide_admin_bar' );
Disable the WordPress admin bar for all users except administrators
function hide_admin_bar( $show) {
if (! current_user_can('administrator')):
return false;
endif;
return $show;
}
add_filter('show_admin_bar','hide_admin_bar' );
Post comment 取消回复