Hide WordPress toolbar from users except for admin and instructor

1. Install Child Theme (Dashboard >> Course Builder >> Child Themes).

2. In the functions.php file of the child theme, put the following code:

$user = wp_get_current_user();
if ( in_array( 'instructor', (array) $user->roles ) ) {
} elseif ( in_array( 'administrator', (array) $user->roles )) {
show_admin_bar(true);
}elseif ( in_array( 'lp_teacher', (array) $user->roles )) {
show_admin_bar(true);
} else {
show_admin_bar(false);
}

Best Deals
Get Eduma Now

For Only *
$439 $69

 
GRAB THE DEAL
* Hurry up! Offer ends this Friday!
close-link
HOT - NEW DEMO!!

TRAVEL & BOOKING
Hotel WordPress Theme

The best WordPress theme for Booking, reservation and hotels, resorts... Just like Air BnB
LEARN MORE - 64$ ONLY $79
close-link
ấdsa
ádasd
ádsad
Subscribe
Give it a try, you can unsubscribe anytime.
close-link
20% OFF all LearnPress premium add-ons

GET 20% OFF COUPON NOW
Your information will never be shared
close-link
Download
LEARNPRESS
WordPress LMS
Download the best WordPress LMS now. Completely Free.
close-link
Learn More