Skip Navigation

Hide WordPress admin bar for non admins

Put this in your themes functions.php
add_action('set_current_user', 'cc_hide_admin_bar');
function cc_hide_admin_bar() {
  if (!current_user_can('edit_posts')) {
    show_admin_bar(false);
  }
}

Related Snippets

See all