Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

Disable Admin Bar for All Users Except for Administrators

Home / Forums / Virtue Theme / Disable Admin Bar for All Users Except for Administrators

This topic is: Not Resolved
[Not Resolved]
Posted in: Virtue Theme
May 26, 2016 at 8:10 am

How do I disable the Admin Bar for All Users Except for Administrators?

I need some users to login to the back-end to view orders but I do not want them to be able to create update/change/anything besides the Orders.

I have unchecked “Show Toolbar when viewing site” for the particular user but no luck.

I found this code after a search but it does not do anything after placing in functions.php – where should I place this code or any other suggestions?

add_action(‘after_setup_theme’, ‘remove_admin_bar’);
function remove_admin_bar() {
if (!current_user_can(‘administrator’) && !is_admin()) {
show_admin_bar(false);
}
}

Thanks
W

  • The forum ‘Virtue Theme’ is closed to new topics and replies.