@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’);`
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.
@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 );`
Try in wp-config.php:
`define ( ‘BP_DISABLE_ADMIN_BAR’, true );`
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.