You could use a function inside your theme’s functions file to selectively disable it for specific users.
function disable_bar_for_user( $ids ) {
if( !is_user_logged_in() )
return;
global $current_user;
if( is_numeric( $ids ) )
$ids = (array) $ids;
if( !in_array( $current_user->data->ID, $ids ) )
return;
add_filter( 'show_admin_bar', '__return_false', 9 );
}
Then call it for the user or users you want to disable the bar for..
Single user:
disable_bar_for_user(1);
Multiple users:
disable_bar_for_user(array(1,2,3));
If you want to just turn it off altogether, then the following should do it(instead of the function).
add_filter( 'show_admin_bar', '__return_false', 9 );
Hope that helps.. 🙂
Related Posts:
- How to use multiple check-box values to work in a function and insert values in database
- Function to return true if current page has child pages
- What are the ADVANTAGES of ORIGINAL wordpress template structure?
- Change admin bar to default:off
- Get author full name
- How to change admin bar color scheme in MP6 / WP 3.8 front end?
- Template for individual post designs
- When to use esc_url, esc_html, esc_attr, and friends?
- Best practices – Should I create a child theme vs. customizing a framework theme? (such as HTML5 reset)
- Excess White Space Above Admin Bar on Frontend Using Twitter Bootstrap
- is there a simple way to list every templates / php files used to generate a specific page?
- What is the best practice for customizing a plugin’s JavaScript/jQuery?
- How the WordPress sidebar works
- Should we localize custom-made themes / plugins?
- Extend walker – navigation, adding data attribute to a tag
- How can I remove the Static Front Page option from the Customizer
- Set front page as static page [closed]
- How to programmatically bring back “excerpts” field in post editor in WP 3.1+
- How can i customize the comment list
- How to keep theme layout the same when admin gray bar is present?
- How to handle theme customization and sass variables
- wp_enqueue_scripts not called on search page?
- wp_head() not inserting the default stylesheet style.css
- Is using eval() ok in this scenario
- First completely customized theme, where should I start?
- WordPress how to override function adjacent_posts_rel_link_wp_head() in link-template.php the correct way
- Theme Customizer not loading
- Modify Javascript Configuration Options for Theme Customizer Colour Picker
- Best practices: Custom theme sidebar menu – hardcode or widget?
- Best approach to create sites with Modular Content? [closed]
- Customizer API and add_panel(). Panel doesn’t show
- Why WordPress architecture is not pure object oriented and it don’t use MVC pattern? [closed]
- How to correctly add JQuery in a WP theme?
- Creating multiple hooks for theme
- What is the best way to handle multiple calls to get_template_directory_uri() and similar functions?
- Displaying theme options in css
- Removing non native customizer settings from a child theme
- How to reorganize the items returned by wp_list_comments()?
- which is the best way to customize nav-menu-template.php?
- Where should I update_options in a theme?
- How to add a button which saves the post then executes a function
- Limitations when modifying wp_title with a filter
- How to edit theme functions file to modify pagination?
- Customizer: active_callback and sanitize_callback incompatibility?
- “Add A Widget” button in the Customizer
- Q: How to pull data from custom table to populate zustomizer setting/control select options
- Move default page templates to sub directory
- Menu jumping when calling it via PHP
- Using My Own Classes On Wp Unit Tests
- Is it possible to visually group items on the theme customizer?
- Displaying icon image for WordPress post formats, is there a cleaner way to do this?
- WooCommerce: multiple input field for multiple product variations
- Redirect to another page using contact form 7? [closed]
- Customizer – loading settings/controls/sections/panels based on a id/page id
- Is there any tool to find lines of codes responsible to generate front-end HTML elements?
- Is there a way to optionally hide the title bar when logged in?
- Child Theme header1.php file not overwriting parent theme’s header1.php file
- How to obtain the current website URL in my theme?
- How to have content scroll over background
- Underscore – Self hosted fonts
- Is there a WordPress boolean for “theme_customizer_active()”?
- searchform.php doesn’t work properly
- Customizer: get_preview_url() inside customize_save_after hook
- How to add custom meta box when you have a custom page template file
- add shortcode support in customizer
- How to call a widget in a loop at a specific iteration value?
- Right procedure when you develop a WP Website for a client
- New to WordPress – Read the Codex, Other Docs; Still Confused
- How to add custom page elements to the WYSIWYG editor?
- Update Specific Key Value in Complex `wp_options` object
- pass html code to worpdress
- Can’t change theme name
- Link to RSS feed not clickable?
- How to custom category template based on category?
- woocommerce remove coupon link does not work
- WordPress Admin bar missing from custom theme
- Rename a folder via HTML POST request
- How to get php file based on URL in WordPress
- How can I customize a WordPress theme before it’s downloaded?
- HTML TO WP Theme : Submenu goes down wp_nav_menu
- Any way to permanently translate themes?
- How to share posts (and plugins) between existing site and new, separate dev/test installation?
- A Customizer checkbox control that sets the setting to “” or to “blank” and show() or hide() a color control
- How to prevent XSS attack in wordpress theme?
- Customizer API way function is_customize_preview() works only in main page?
- Support Multiple featured images
- WordPress 3.5 + Foundation 5 not working on IE9
- What hook to use for loading a custom class extension during Theme initialization?
- trying to figure out how to use more that one image upload in the same section in theme customizer
- Theme Option’s Save Button is not working
- WordPress causing all code to be displayed on line 1. Receiving multiple errors after cleaning cookies and cache
- Post thats in Two Categories, only want to display name for one
- Im using a right approach to use this class inside WordPress theme?
- Upgrade to WP 3.2/ and Server to php5 breaks theme? [closed]
- Best practice to create required pages
- Permalinks problem with custom theme
- How can i move my product name & price from below thumbnail to be the rollover content in Avada & Woocommerce?
- How to split the site’s layout without damaging this layout? [closed]
- Multiple content areas with Gutenberg – Transparent areas mid content
- How to set up a development/staging site to make major changes to the theme then update on the live site?