Snippet: Show Admin bar to Administrator Only

Add following snippet to “functions.php”

Snippet

add_action('init','hide_admin_bar_func');
function hide_admin_bar_func() {
    if (!current_user_can('administrator')) {
      show_admin_bar(false);
    }
}

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>