anonymous user menu in wp admin bar?
-
Hey everyone,
I’m using the buddypress plugin and I want to have the same sort of profile menu they have for anonymous users when they enter the site. I want it to appear just like how the buddypress.org website does it.Is this something I can simply enable in my wordpress installation or do I have to cutomize the wp admin bar myself somehow?
I’ve looked at the following topic:
https://codex.buddypress.org/getting-started/guides/deprecated-guides/modifying-the-buddypress-admin-bar/but couldn’t really figure out how to make the anonymous user profile menu appear in the wp admin bar :/
This is what I’m trying to achieve:
http://imgur.com/bLeEb2nThe same profile menu pops up for users that are logged in, however the entries contain different links and such, which is expected.
Also, if I can get this to work I would like to remove the login and register admin bar entries for logged out users since they are then inside the anonymous user profile menu.
I’ve already tried creating the following code in my functions.php:
add_action( 'admin_bar_menu', 'custom_admin_bar_profile_anon' ); function custom_admin_bar_profile_anon($wp_admin_bar) { if (!is_user_logged_in()) { $wp_admin_bar->remove_menu('wp-admin-bar-bp-login'); $wp_admin_bar->remove_menu('wp-admin-bar-bp-register'); $wp_admin_bar->add_menu('wp-admin-bar-my-account'); } }This however does nothing :/
Any ideas?
The topic ‘anonymous user menu in wp admin bar?’ is closed to new replies.