Comments on: How to Hide WordPress Admin Bar in Every Way https://plugins-for-wp.world/blog/hide-admin-bar-wordpress/ Premium WordPress Plugins And Themes For An Affordable Price Mon, 15 Aug 2022 20:40:58 +0000 hourly 1 https://wordpress.org/?v=6.8.3 By: PluginsForWP https://plugins-for-wp.world/blog/hide-admin-bar-wordpress/#comment-13647 Tue, 15 Feb 2022 17:14:04 +0000 https://plugins-for-wp.world/?p=17981#comment-13647 In reply to Jen Niles.

You can do it with CSS. Which link would you like to hide? I can provide you with the code.

]]>
By: Jen Niles https://plugins-for-wp.world/blog/hide-admin-bar-wordpress/#comment-13646 Tue, 15 Feb 2022 17:03:03 +0000 https://plugins-for-wp.world/?p=17981#comment-13646 How to hide one item link in the top admin bar? I don’t want to hide the whole top admin bar but one link that appears in the top admin bar. Thanks!

]]>
By: PluginsForWP https://plugins-for-wp.world/blog/hide-admin-bar-wordpress/#comment-7533 Thu, 09 Sep 2021 19:00:56 +0000 https://plugins-for-wp.world/?p=17981#comment-7533 In reply to Jim.

Hi, please try this:
// Hide admin bar from subscribers
add_action(‘after_setup_theme’, ‘pfwp_remove_admin_bar’);
function pfwp_remove_admin_bar() {
$display_bar = array(‘administrator’, ‘author’, ‘editor’);
if( !array_intersect($display_bar, (array) wp_get_current_user()->roles ) ) {
show_admin_bar(false);
}
}

]]>
By: Jim https://plugins-for-wp.world/blog/hide-admin-bar-wordpress/#comment-7530 Thu, 09 Sep 2021 16:08:29 +0000 https://plugins-for-wp.world/?p=17981#comment-7530 Thanks. How can you extend the code example to show the admin bar only for a list of roles, like administrator, editor, author? Or perhaps more simply, users with a certain capability, like ‘edit_posts’?

]]>