Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

remove admin-bar (17 posts)

Started 3 years, 3 months ago by: Blogono

  • hello,
    is it possible to remove the default buddypress admin-bar at some themes (eg the home theme) if you want ??

    is there any hook that calls the admin-bar and that can be removed in the template-files??

    regards,
    mark

  • Profile picture of Burt Adsit Burt Adsit said 3 years, 3 months ago:

    In bp-core-adminbar.php are the two hooks:

    add_action( ‘wp_footer’, ‘bp_core_admin_bar’, 8 );
    add_action( ‘admin_footer’, ‘bp_core_admin_bar’ );

    These fire up the admin bar. If you want to remove it just put the following in your bp-custom.php file:

    remove_action( ‘wp_footer’, ‘bp_core_admin_bar’, 8 );
    remove_action( ‘admin_footer’, ‘bp_core_admin_bar’ );

    You’ll have to wrap those two calls in some logic of your own creation to decide when to not display the admin bar.

  • thats great … thank you a lot, burtadsit!

    just added the code at the buttom of the home-template and the admin-bar disappeared

    thx
    regards,
    mark

  • better to add the code at the index-file of your home template.

    regards,
    mark

  • Hi
    I added the code at the index-file and the Admin-bar was removed. But now there is a white background in its place,
    any ideas to remove this, white background, also?

  • Profile picture of Burt Adsit Burt Adsit said 3 years, 2 months ago:

    The css reserves a spot for the admin bar.

    remove_action( ‘wp_head’, ‘bp_core_admin_bar_css’, 1 );

    Wherever you put the other statements.

  • HI
    Thanks for the tip, it didn’t work though.

    remove_action( ‘wp_footer’, ‘bp_core_admin_bar’, 8 );
    remove_action( ‘admin_footer’, ‘bp_core_admin_bar’ );
    remove_action( ‘wp_head’, ‘bp_core_admin_bar_css’, 1 );

    do you have any idea of wear to put all the code, which particular file?

  • For all rookies out there, like me,
    if the remove_action doesn’t work for you: I did this and the css-adminbar was removed:

    in the bp-core-cssjs.php file

    add “//” to this line: add_action( ‘wp_head’, ‘bp_core_admin_bar_css’ );

  • Profile picture of Lance Willett Lance Willett said 3 years, 1 month ago:

    As of revision 1270 in trunk you can now disable the admin bar like this in your “wp-config” file:

    define('BP_DISABLE_ADMIN_BAR', true);

    That way you don’t need any of those custom overrides in your “bp-custom” file.

  • Profile picture of Thord Daniel Hedengren tdh said 3 years, 1 month ago:

    Am I doing something wrong here? I don’t seem to be able to use those overrides in the bp-custom.php file, probably because it is called before the admin bar functions gets registered. How should I do this?

    Edit: I don’t actually want to REMOVE the admin bar altogether, just hack the stuff it does without touching core.

  • Profile picture of Thord Daniel Hedengren tdh said 3 years, 1 month ago:

    I think I solved this to my liking. Putting these things in a plugin and running it in mu-plugins did the trick. :)

  • Profile picture of Burt Adsit Burt Adsit said 3 years, 1 month ago:

    Thord see this post here: http://buddypress.org/forums/topic.php?id=2186

  • Profile picture of valuser valuser said 9 months, 2 weeks ago:

    define(‘BP_DISABLE_ADMIN_BAR’, true); worked up to 1.29
    in bp 1.5 beta 2 on a multisite it works but whitespace takes it place

  • Profile picture of valuser valuser said 9 months, 2 weeks ago:

    define(‘BP_DISABLE_ADMIN_BAR’, true); + Hide admin bar for logged out users NO works

  • Profile picture of Andrés Richero Andres Richero said 8 months, 4 weeks ago:

    any news on hiding the admin bar and not getting the whitespace on bp 1.5 beta 2? thanks