Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: wordpress top bar

@vapvarun

Participant

@mechwiy You can add a new class to the body based on role
Added following codes inside child theme functions.php or using snippet plugin

add_filter( 'body_class','adminbar_body_classes' );
function adminbar_body_classes( $classes ) {
 
if ( !current_user_can( 'level_10' ) ) {
				$classes[] = 'no-adminbar';
			}
     
    return $classes;
     
}

after that add following inside custom CSS using customizer

html body.no-adminbar {
    margin-top: -32px !important;
}
body.no-adminbar #wpadminbar {
    display: none;
}
Skip to toolbar