remove admin-bar
-
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
-
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?
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’ );
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.
Thord see this post here: https://buddypress.org/forums/topic.php?id=2186
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 placedefine(‘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 fileOR, 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.
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?
- The topic ‘remove admin-bar’ is closed to new replies.