you can use this
add_action('after_setup_theme', 'remove_admin_bar');
function remove_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
show_admin_bar(false);
}
}
Related Posts:
- Should all plugins be encapsulated in a Class?
- Consuming an external API in WordPress?
- How can I import a class privately into a plugin?
- How do I extend one plugin I’m writing with another I’m writing using classes?
- Automatically Creating Posts for Popular Forum Topics or Products [closed]
- Generate custom output for page/URL in a plugin
- Post source link plugin – small modification
- Add CSS animation as Preloader to WordPress
- How to list the Hooks and order of execution in current loading page? [duplicate]
- How to turn off email you receive when registered?
- Setting up widgets in wordpress with a unique ID for the after_title argument
- Modifying Footnote Plugin for Descriptive Title Attributes
- How to Replace Words with Hypertext Link But Ignore Previously Existed Links?
- force customers to add only single item to card per purchase EDD [closed]
- How to get member list based on role by using buddypress?
- Auto delete WordPress users according to time
- Wp favorite posts get user favorites in profile using buddypress [closed]
- Edit Yoast SEO breadcrumbs output [closed]
- How would I go about creating a user ranked post popularity page?
- wp_set_auth_cookie causes 403 error in the wooCommerce checkout
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- Redirect to another page using contact form 7? [closed]
- Inserting custom PHP script on homepage
- Loop in elementor custom widget not working
- I am trying to make a field show and save from quickedit screen
- .php file for woocommerce edit category? [closed]
- Customize Menu | Styling LESS/SCSS code formats
- Why is it important to check for isset and is_array before checking in_array in this example?
- Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile
- Calling a save function from a “submit” button
- same user role or copy the user role to be same as the other role
- Different registration form for different roles
- How to fix these PHP Warnings with the “Feed JSON” plug-in?
- woocommerce remove coupon link does not work
- implement custom roles in custom plugin
- Post source link plugin – small modification
- Custom Plugin: How to Include Install Buttons of other 3rd Party Plugins?
- Adding discount functionality to the cart
- How to assign a specific service to a specific provider based on location
- Precheck fields when I add a new post
- Rename a folder via HTML POST request
- Move plugin pages from dashboard to front-end
- working code, not working – Plugin Dev
- Cron job shedules replace?
- Custom shortcode being shown in WPBakery backend rather than the block
- Move plugin upload folder from mywebsite.com/wp-content/uploads/pdfuploads to mywebsite.com/pdfs?
- Woocommerce list variations that are added already to cart in Single Product
- Flexslider empty slide
- Limiting buddy press features based on membership level (PMPro)
- Custom SportsPress list
- Overwrite user role
- Edit Buddypress Groups Activity Page Text [closed]
- How to fix vanilla comments extra iframe space
- Buddypress Plugin for register user from other site’s [closed]
- How to delete remain data in WP database after deleting custom post via admin interface
- What can I do to customize a widget provided with this plugin? from where have I to start?
- WordPress: code structure
- WordPress isn’t sending welcome email with the password reset
- How to make a Template page to show the information of different things Shop and Product page?
- bulk change of image setting “link to” to “link to: image url “
- How to add rewrite rules and pagination to retrieve attachments files?
- Displaying Gravity Form data on WordPress page [closed]
- Improving a Stackoverflow “inspired” badge system to display badges in author page
- WordPress and WebRTC?
- Get a list of galleries from an album in NextGEN Gallery [closed]
- How to install and activate a plugin via an external PHP script
- how to include a simple jquery file into a wordpress plugin
- Calling a plugin in theme development
- Will Flutter work with WordPress 3.0?
- Display a text message if the field is not found and not if found
- Unable to activate wordpress importer after installing it
- Reposition Woocommerce Message
- Leveraging WordPress Comments on Custom Plugin Object page
- Copyright messages for a particular set of pages
- Sanitizing, Validating and Escaping in WordPress (Plugin)
- Debugging Technique Question re: functions.php
- Get total number of comment of the posts written by an author
- Check if User exists in WordPress Multisite
- Displaying a Welcome Message to a Woocommerce User
- How do you remove plugin edit option?
- Is there a way to alter the order in which the plugins appear in the page?
- Getting Post details when post is published
- Escape when echoed
- Scope for PHP Variables Assigned in functions.php or a plugin
- add_meta_box (Will display only in specific page admin WordPress)
- Override the filter from plugin in child theme
- Make specific products accessible only to a user role in WooCommerce
- Undefined property: WP_Post_Type::$ID
- Preventing BFA in WordPress without using a plugin
- Plugin exceeds memory limit
- How to get post URL in the_content filter?
- How to remove xmlns on language_attributes()?
- How to write one comment and publish on every post using database or plugin?
- Add a plugin before main container
- Shortcode to generate and save password in a file
- Custom plugins/Manipulated plugins: Always a terrible idea to inherit these types of WP sites that discourage updates? [closed]
- How to get subscription key or id using Woocommerce Subscriptions [closed]
- Delete Associated Media Upon Page / Post Deletion
- I don’t understand how this parameter works..?
- Why wp_mail() function isn’t sending any emails and displaying ‘0’ in Chrome ‘Network’ response