Skip to:
Content
Pages
Categories
Search
Top
Bottom

Disable Admin Bar on Selected Blogs

  • Avatar of member11
    member11
    Participant

    @member11

    I’ve discovered this fix from this page:

    Disable the admin bar / buddybar at the top of every screen:

    define ( ‘BP_DISABLE_ADMIN_BAR’, true );

    http://codex.buddypress.org/how-to-guides/changing-internal-configuration-settings/

    But is there a way to have it disabled on just one or other blogs?

    My particular request is to have it disabled on my home page.

    I’m running Buddypress from another blog ID and will have the bar appear across all sub-blogs except the root.

    Any ideas would be appreciated. Thanks for your help.

    Paul

Viewing 2 replies - 1 through 2 (of 2 total)
  • Avatar of Ivan Ong
    Ivan Ong
    Participant

    @pinobolino

    I tried to do this, but it doesn’t seem to work. can anyone help?

    <?php
    define ('BP_ROOT_BLOG', 2);
    if (blog_id!=BP_ROOT_BLOG) {
    remove_action( 'wp_footer', 'bp_core_admin_bar', 8 );
    }
    ?>

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    hi Ivan

    try this one, put it into your bp-custom.php

    function remove_bpadminbar(){
    global $current_site;
    if($current_site->blog_id!=BP_ROOT_BLOG) {
    /*if current blog is not the one on which buddypress is activated*/
    remove_action( 'wp_footer', 'bp_core_admin_bar', 8 );//remove buddypress admin bar
    }

    }
    add_action("wp","remove_bpadminbar");

    This should work.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.