You should use conditional tag inside function hooked to show_admin_bar
filter.
add_filter( 'show_admin_bar', 'show_adminbar_on_homepage_only', 20 );
function show_adminbar_on_homepage_only()
{
return is_user_logged_in() && is_front_page();
}
You should use conditional tag inside function hooked to show_admin_bar
filter.
add_filter( 'show_admin_bar', 'show_adminbar_on_homepage_only', 20 );
function show_adminbar_on_homepage_only()
{
return is_user_logged_in() && is_front_page();
}