Want to hide the admin bar from frontend in your WordPress website, then keep close attention in this post. In this post i will explain a simple code which will hide admin bar.
Open your current activated theme’s functions.php page & simply copy and paste the bellow code at the bottom of your page for hide the admin bar to all logged in users except admins. This is very useful for those sites that have public registration and login turned on.
1 2 3 4 5 6 |
< ?PHP if (!current_user_can('administrator')) : show_admin_bar(false); endif; ?> |
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: hide admin bar in wordpress, remove admin bar from frontend, wordpress