Created
October 13, 2017 07:40
-
-
Save Cathrin-Demyokhina/dec28560fea3b54e392be236e6e1d55a to your computer and use it in GitHub Desktop.
WP disable top bar menu for all users except admin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment