Sunday 17 December 2017

Disable Admin Bar in wordpress.

Paste this code in your theme’s functions.php file


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

If you want to disable it for all users, then simply put use this code in your theme’s functions.php file



  show_admin_bar(false);

No comments:

Post a Comment