By default, as long as your are logged in at a WordPress site, you will see a admin bar at the top. However, if you are site admin, i’m sure you do not wish to show the admin bar to non admin member. Of course this will also avoid many unnecessary issue.
To hide admin bar from subscriber or non admin in WordPress, follow the steps below:-
Advertisements
- Open your theme functions.php and paste the code below to the bottom of the file.
/** * Remove admin bar from non admin user */ add_action('after_setup_theme', 'remove_admin_bar'); function remove_admin_bar() { if (!current_user_can('administrator') && !is_admin()) { show_admin_bar(false); } }
- Once done, all he non member will not see the admin bar again.
Related posts:
How to block .log file using in .htaccess
Woocommerce: How to bcc all order email to multiple recipients according to status
How to register a free @microsoft.com email account?
Contact Form 7: Clear all field except specific after submission
Symfony 1.4 - Customize Admin Generator listing to show data from foreign tables
The Common Internet Error Code
WordPress: How to create left sidebar template in TwentyEleven theme?
How to change shop title in Woocommerce
Share this with your friends:-