If you are using WordPress than you might be quite aware of the thing called Admin Bar. It is the bar that apears at the top of your WordPress site when you are logged in. Today I will tell you how to show this bar to admins only.
Why only admins?
- If you have a multi author blog, then admin bar may have a bad impact
- If you add any thing to admin bar, that is in relation to admin control you need to keep it secure
- Admin bar sometimes messes up the layout so better remove it for non admins
How to do it?
Put this code in your activated theme's functions.php file & You are done
<?php// Snippet code goes here!if (!current_user_can('administrator')) :show_admin_bar(false);endif;?>