Paste this snippet in your theme’s functions.php file to hide admin bar for all users except admin.
add_action('after_setup_theme', 'hide_admin_bar');
function hide_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
show_admin_bar(false);
}
}
Need Professional Support for Your Website Problems?
Whether you're facing website issues or struggling with code implementation, our team is here to assist. Hire us to get your website back on track.
Hire Us