Remove Admin Bar for all Users except for Administrators

jdunhin

New member
Joined
Feb 27, 2013
Messages
93
Points
0
Paste the code in your themes function.php
PHP:
add_action('init', 'remove_admin_bar');
function remove_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
  show_admin_bar(false);
}
}
Or remove it completely for all users
PHP:
show_admin_bar(false);
 

hoangvu

New member
Joined
Jun 6, 2012
Messages
1,889
Points
0
Thanks for good code!
It's great if you can show a screenshot in your tips to explain for everyone easy to understand.
 
Older threads
Replies
0
Views
1,328
Replies
2
Views
3,031
Replies
6
Views
2,583
S
Replies
1
Views
3,087
Newer threads
Latest threads
Replies
0
Views
9
Replies
0
Views
16
Replies
0
Views
19
Replies
0
Views
16
Replies
0
Views
28
Recommended threads

Latest postsNew threads

Referral contests

Referral link for :

Sponsors

Latest Blog ArticlesMost Viewed Threads

Popular tags

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top