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?
- is_plugin_active function doesn’t exist
- __(): What if I have to pass in a variable?
- Run WP-CLI using PHP
- PHP Deprecated: Non-static method should not be called statically
- How to edit plugin’s html? [closed]
- Check if a class exists within a method
- Escape special characters in image link
- Programatically download a plugin
- Error shown for Trying to get property ‘roles’ of non-object in WordPress After Content for User Roles
- WordPress Registration Email by Role
- How to show Recent Page instead of Post?
- CSS from textarea in options page to frontend what to do
- Overide plugin files from child theme (/inc/ ) folder
- add image crop function like in wp customizer
- Add ALT attribute to Pin It Button image to pass HTML5 validation
- Add some fileds to the wp_posts table
- How do I add $_SESSION[”] to my wordpress page?
- The add_action(‘register_form’) isn’t effecting my registration form
- override function from my plugin [closed]
- WordPress Stats Plugin: Display Post Views [closed]
- Pagination not working
- Custom content plugin for front page in wordpress
- Bulk User Deletion
- need to find duplicated meta value in custom filed and view the posts that have the same value
- Can I disable xml-rpc by setting it to false?
- Give custom page template a custom post ID
- Push Contact form 7 variable to front end after submission
- Add a parameter at the end of the url and prettify
- Share my WordPress plugin for updating how?
- How can I change page content for good once a button is pressed?
- Google Maps for Woocommerce Checkout
- Add two row of code to the public static function init of a plugin
- Get and Update Most Meta Value as an array in HTML form
- WordPress filter from custom table is not working properly
- Configuring default woo commerce login with modal popup
- The etiquette of forking a plugin and table tag
- How can I remove this sidebar from my Search Results page?
- Confusing problem with displaying message recipient metadata
- How to make my plugin insert text into a custom div?
- From a legal perspective, is it okay to customize a plugin’s code?
- Does anyone have the Custom Post Permalinks plugin from John P. Bloch? [closed]