Skip to:
Content
Pages
Categories
Search
Top
Bottom

Show BP Admin Bar while in wp-admin ONLY and hide it in the rest of the site.

  • Avatar of ri-kun
    ri-kun
    Participant

    @ri-kun

    I had no problems with the BP admin bar while I was still using this code for the footer:

    It didnt appeared in the mainpage, while opening and while reading posts and in any parts of the site excluding while I was in wp-admin area. I wanted the BP admin bar to appear only in wp-admin and not in the rest of the site.

    The buddypress admin bar started appearing to the areas I dont want it to appear after I change this:”” to this:”” since I have to change so that the twitter button will work and other plugins.

    So again, how can I have the BP admin bar to appear only in the wp-admin and NOT in the rest of the site?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Avatar of ri-kun
    ri-kun
    Participant

    @ri-kun

    please help

    Avatar of ri-kun
    ri-kun
    Participant

    @ri-kun

    please help

    Avatar of pcwriter
    pcwriter
    Participant

    @pcwriter

    @ri-kun

    Add the following snippet to your theme’s functions.php file:

    `function remove_adminbar_from_mainsite() {
    if(‘BP_ROOT_BLOG’)
    remove_action( ‘wp_footer’, ‘bp_core_admin_bar’, 8 );
    }
    add_action(‘wp’, ‘remove_adminbar_from_mainsite’);`

    Avatar of nermion
    Nermion
    Member

    @nermion

    Hi how could I do the same for wp-admin area. Also I’d like to keep it on the rest of the site but remove it from the admin.

    Avatar of imjscn
    imjscn
    Participant

    @imjscn

    @pcwriter , can I use your code to remove adminbar from dashboard? I tried the following 3 modifications, neither of them works:
    `if( is_admin())
    remove_action( ‘wp_footer’, ‘bp_core_admin_bar’, 8 );`
    or
    `if( is_admin())
    remove_action( ‘admin_footer’, ‘bp_core_admin_bar’, 8 );`
    or
    `add_action(‘bp_loaded’, ‘remove_adminbar_from_dashboard );`

    Avatar of Virtuali
    Virtuali
    Participant

    @gunju2221

    Try in wp-config.php:

    `define ( ‘BP_DISABLE_ADMIN_BAR’, true );`

    Avatar of dodisabaruddin
    dodisabaruddin
    Member

    @dodisabaruddin

    Ouch..It’s a rude way. The code just killing the admin bar, and lefting some space.

    Hello everyone,

    Add the codes below to your theme’s function.php file :

    add_action(‘admin_head’, ‘adminbarhide’);
    function adminbarhide() {
    define(‘BP_DISABLE_ADMIN_BAR’, true);
    }

    then go to wp-content/your-theme-directory/_inc/css/adminbar.css and change “padding-top: 25px” on second line to “padding-top: 0px” ,
    this code will remove admin bar only from your dashboard, and css code will hide white space after removing admin bar.

    after all I’m sorry about my bad English if there was some wrong spelling.

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

You must be logged in to reply to this topic.