Latest Post

How to Disable WordPress Admin Bar for All Users Except Administrators

How to Disable WordPress Admin Bar for All Users Except Administrators

How to Disable WordPress Admin Bar for All Users Except Administrators

This code use for Disable admin bar for all user in wordpress.

<?php 

add_action('after_setup_theme', 'remove_admin_bar');
 
function remove_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
  show_admin_bar(false);
}
}

?>

No comments