BuddyBoss Home – Web › Support Forums › Themes › Boss. theme › Multisite – Show the Toolbar for logged out users
Tagged: admin bar, buddypress, multisite
- This topic has 3 replies, 2 contibutors, and was last updated 9 years, 3 months ago by Anonymous.
Question
August 18, 2015 at 8:46 pm #44680@rotjuHi there,
I’m running a multisite with buddypress and Boss theme on the main site. Now I would like to to disable the admin bar for all my subsites so I disabled the setting “Show the Toolbar for logged out users” at the buddypress settings.
But this causes the login and register buttons to disappear in the navigation menu of the Boss theme.
I tried adding the code “show admin bar true” in the functions.php of my child theme. But that didnt work unfortunately.
So how can I make sure the admin bar is showing at all times at the main site (using the boss theme) and hide it at all times on all my subsites?
Cheers,
RonaldAnswers
August 19, 2015 at 3:17 am #44688@
AnonymousHi @rotju , We are using wp-admin bar to generate left and mobile menu. It will be compulsory to keep admin-bar settings enabled. You can use hide admin bar plugins in subsite, but do not network activate them. using this approach admin bar will be hidden on subsite only.
Regards
August 19, 2015 at 9:40 pm #44741@rotjuHi @vapvarun , thank you for your reply.
Here is a solution for anyone else having the same dilemma as me.
Put this code in your subsite theme’s functions.php:add_filter( 'show_admin_bar', 'hide_admin_bar_from_visitor', 9999 ); function hide_admin_bar_from_visitor() { if( ! is_user_logged_in() ){ return false; } return true; }
And it will hide the admin bar for visitors.
Credits goes to Ash
http://premium.wpmudev.org/forums/topic/subsite-hide-admin-bar-from-logged-out-usersCheers,
RonaldAugust 19, 2015 at 11:32 pm #44743@
AnonymousGlad you find the solution. I will close this topic.
Regards
Varun
- The question ‘Multisite – Show the Toolbar for logged out users’ is closed to new replies.