Friday 30 August 2013

How to remove admin bar from non admin users in wordpress?

Hi All,

Please add following script into your 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);
    }
}

Cheers!

No comments:

Post a Comment