Place this code in bp-custom.php or functions.php
of your theme.
if ( ! is_super_admin() ) {
add_filter( 'show_admin_bar', '__return_false' );
}
Thank you!
It works fine, but when a (non-administrator) user is logged in, they cannot log out anymore because the logout button is missing which you can find in the “Howdy… [name][avatar][settings][logout button]” box at the upper right side. Also missing is the name of the user with his avatar, messages / notifications, etc. So this box is missing.
So what I need is a script that hides the admin bar on the front end when you’re logged out, but is visible when you’re logged in.
Any idea?
ThanX!
Install (BuddyPress) Log in
widget in sidebar. It will have both login form and logout link.
http://screencast.com/t/J37U1SgxRb
Hi Slava,
Thank you!
I have a different theme and layout than yours. No sidebars.
Need a small simple script that shows only admin bar when you’re logged in.
I’m not a coder but I need something like this:
if user is logged in => show admin bar.
if ( ! is_user_logged_in() ) {
add_filter( 'show_admin_bar', '__return_false' );
}
YES!!!
That did the trick! It works.
Thank You so much!