The basic WordPress function for hiding the admin bar is:
show_admin_bar(false);
To show it to users with administrative privileges:
if ( ! current_user_can( 'manage_options' ) )
{ show_admin_bar( false ); }
For newer versions of WordPress, you may need this instead, so it shows the admin bar in the dashboard:
add_filter('show_admin_bar', '__return_false');
Dev & Tech Notes
San Diego | Los Angeles | Big Bear | USA
Terms & Conditions ©2005-2024 TJohns.co
Terms & Conditions ©2005-2024 TJohns.co
Articles in this Category
- Add Menus to Wordpress
- Changing Admin Password in WordPress Database
- Hide Admin Bar on Front End
- Hook References
- Inserting New Admin into WordPress Database
- List of WordPress Template Tags
- Reading from & Writing to the WordPress Database
- Some WordPress Basic Variables
- Some WordPress Conditionals
- Using Arrays in WordPress Database
- Using Custom Field in WordPress for Conditional Statement
- WordPress Login & Logout Redirect
- WordPress Logout Menu Link
Top Left Text cha
Web & App Development
Hide Admin Bar on Front End
- Details
- Written by Timothy Johns
- Category: WordPress
- Hits: 1312
Comments