• Resolved margauxmci

    (@margauxmci)


    Hello,

    I have a problem on my site. I use the “Members” extension in order to have users “guest” on this site. They have access to pages where non-registrants do not have access.

    But when a person is logged in as a “guest”, we see the black bar of WordPress at the top. I have modified and defined the roles but I can not remove this tape.

    Can you help me? Thank you!

    • This topic was modified 2 years, 10 months ago by margauxmci.
Viewing 1 replies (of 1 total)
  • Plugin Author Caseproof LLC

    (@caseproof)

    Hi @margauxmci

    To remove admin bar on front-end, you can try to add the code below at the end of your theme’s functions.php file:

    add_filter( 'show_admin_bar', function( $show ) {
    	$user = wp_get_current_user();
    	if ( ! is_user_logged_in() || ( ! empty($user) && in_array( 'administrator', (array) $user->roles ) ) ) {
    		$show = false;
    	}
    
    	return $show;
    }, 999 );

    I hope that helps.

Viewing 1 replies (of 1 total)

The topic ‘Remove wordpress banner’ is closed to new replies.