BuddyBoss Home – Web Support Forums Themes Boss. theme Multisite – Show the Toolbar for logged out users

Viewing 4 posts - 1 through 4 (of 4 total)
  • Question

    #44680

    Hi 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,
    Ronald

    Answers

    #44688
    @vapvarun

    Hi @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

    #44741

    Hi @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-users

    Cheers,
    Ronald

    #44743
    @vapvarun

    Glad you find the solution. I will close this topic.
    Regards
    Varun

Viewing 4 posts - 1 through 4 (of 4 total)
  • The question ‘Multisite – Show the Toolbar for logged out users’ is closed to new replies.