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
- When to use is_home() vs is_front_page()?
- Why have on every line
- Using classes instead of global functions in functions.php
- 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
- Include a external PHP file into a WordPress Custom Template
- List of all theme customizer control types?
- Get author full name
- How to change admin bar color scheme in MP6 / WP 3.8 front end?
- Template for individual post designs
- How to remove hardcoded characters from playlists?
- 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
- How can you develop on a live WordPress installation that is using W3 Total Cache? [closed]
- Admin Bar (Toolbar) not showing on custom PHP file that loads WordPress
- First wordpress blog, should I make my own theme for maximum customizability?
- 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?
- Set the transport of the Customizer ‘header_image’ core setting to ‘postMessage’
- Front End Post Submit Form
- Feature Survey – What would you want in a resume theme?
- How to display admin bar when using WP_USE_THEMES = false?
- How the WordPress sidebar works
- Should we localize custom-made themes / plugins?
- 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
- Clearing dummy data before launch
- How to call a widget in a loop at a specific iteration value?
- Right procedure when you develop a WP Website for a client
- Is there a hack for using is_page() within the function.php file?
- Woocommerce Product attribute not imported with wordpress Importer [closed]
- New to WordPress – Read the Codex, Other Docs; Still Confused
- Create theme for mobile phones and tablets only?
- How to add custom page elements to the WYSIWYG editor?
- Using the media library for theme customization
- Alternatives to handle customizer settings
- Update Specific Key Value in Complex `wp_options` object
- pass html code to worpdress
- Can’t change theme name
- Remove/Hide a Widget on a Custom Template
- My contact form – I’ve changed the source code but the changes are not being applied
- Setting a post’s category
- 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
- What is difference between add_theme_support and Theme Customization API?
- Is hand coding required at all?
- Text View (Code View) in WordPress Customizer TinyMCE Editor
- how to edit woocommerce checkout page
- How to get php file based on URL in WordPress
- What is the best practice workflow for new website overhaul and keeping current SEO ranking? [closed]
- WordPress Twenty-Fourteen: How to Remove Home Page Header Image from Other Pages
- How can I customize a WordPress theme before it’s downloaded?
- WordPress menu walker – Get parent item text inside end_lvl function
- How to dowload and edit content of a website
- HTML TO WP Theme : Submenu goes down wp_nav_menu
- Add a customize control depending wich radio setting is checked
- Where can I find the declaration of `$_wp_theme_features`?
- Any way to permanently translate themes?
- WordPress Customizer Help with FontAwesome Icon
- Undefined index: custom_sidebars
- How to share posts (and plugins) between existing site and new, separate dev/test installation?
- Display tab title as ‘blog tagline | blog title’
- 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?
- My customizer’s setting doesn’t set to the default and needed to click the control’s “Default” button before it’ll be set
- Best strategy for providing theme options using customizer
- Customizer API way function is_customize_preview() works only in main page?
- page.php is not called when I load a Page
- Support Multiple featured images
- WordPress 3.5 + Foundation 5 not working on IE9
- How Does One Create a Global Variable Repository
- 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
- How to add button to top of theme customizer?
- How to convert that page to a wordpress template? [closed]
- Show post thumbnail only if it exists using timthumb
- Not Found when using activity stream as front page with BuddyPress
- Post thats in Two Categories, only want to display name for one
- How do I change the tagline input to textarea?
- WordPress theme Modifications not showing up on live server
- Im using a right approach to use this class inside WordPress theme?
- Upgrade to WP 3.2/ and Server to php5 breaks theme? [closed]
- Turning WordPress Into full-featured website?
- Best practice to create required pages
- Permalinks problem with custom theme
- How customizable is a self-hosted WordPress blog compared to a Blogger blog?
- 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?
- Capture the Selected Radio Button Value between two files in wordpress theme