Only show admin bar to administrators

Paste this code in your theme’s functions.php file to hide the admin bar to all logged in users except admins. Useful for sites that have public registration turned on.

Code Snippet:

<?php

// Snippet code goes here!
if (!current_user_can('administrator')) :
  show_admin_bar(false);
endif;

?>

Posted in Admin area, Conditional