Skip to:
Content
Pages
Categories
Search
Top
Bottom

remove admin-bar

  • Avatar of Blogono
    blogono
    Participant

    @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

Viewing 19 replies - 1 through 19 (of 19 total)
  • Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    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.

    Avatar of Blogono
    blogono
    Participant

    @blogono

    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

    Avatar of Blogono
    blogono
    Participant

    @blogono

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

    regards,

    mark

    Avatar of Filan
    Filan
    Participant

    @filan

    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?

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    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.

    Avatar of Filan
    Filan
    Participant

    @filan

    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?

    Avatar of Filan
    Filan
    Participant

    @filan

    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’ );

    Avatar of Lance Willett
    Lance Willett
    Participant

    @lancewillett

    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.

    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.

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

    Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    Avatar of valuser
    valuser
    Participant

    @valuser

    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

    Avatar of valuser
    valuser
    Participant

    @valuser

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

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

    still the same on bp 1.5 beta 3 – any idea?

    ok, found away
    just add remove_action( ‘bp_init’, ‘bp_core_load_buddybar_css’ ); to the functions.php file

    Avatar of bigdaddyteemoe
    bigdaddyteemoe
    Participant

    @bigdaddyteemoe

    OR, you can be super lazy and add this at the bottom of your footer

    #wpadminbar {
    display: none;
    }

    Of course, this goes in a style tag, but it won’t show up because these comments support nodes.

    No muss, no fuss.

    Avatar of Developer ICAN
    Developer ICAN
    Participant

    @richardicanie

    In the latest BuddyPress – 1.9 – i want to hide the admin bar but keep it for WP site users (editors, admins) that aren’t BP users? Is that possible?

    Avatar of mattg123
    mattg123
    Participant

    @mattg123

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

You must be logged in to reply to this topic.