You can hook stylesheet_uri which lets you override the URL to the active theme or child theme’s style.css:
function epf_stylesheet_uri() {
return plugins_url( '/stylesheets/style.css', __FILE__ );
}
add_filter( 'stylesheet_uri', 'epf_stylesheet_uri', 10, 1 );
This will then use your plugin’s style.css instead of the theme’s. But IMO if you want to override the style you should really be changing the theme instead.
Related Posts:
- Settings API updated messages won’t show if custom admin page not hooked into add_options_page()
- How can I load a page template from a plugin?
- How to call images from your plugins image folder?
- Why does WordPress have a noop.php file?
- Overwrite theme file from plugin
- Any examples of adding custom fields to the category editor?
- How-to implement admin Ajax inside an admin WP_List_Table?
- What is the etiquette on extending a plug-in
- How to pass a parameter to this add_filter example [duplicate]
- How to get Post ID with the Add Filter Function
- WP 3.3 Tooltips API?
- Clarity needed on usage of multiple 403 forbidden header() functions at the beginning of the plugin files
- Preparing a string in an array for localization
- Cron firing my function everytime wp-admin is visited
- How to Use WordPress Color Picker API in Custom Post Type Metabox
- Formatting of curly brackets array from WP database to get more readable output
- How to find attachment ID for first image in a post
- WP_Error handles errors, but how can I show success with a message?
- How to determine wordpress base path when wordpress core is not loaded
- Calling a function from functions.php in custom page/ blog post
- update_option is not working!
- What URL do you pass to wp_remote_get to load the body of the current post’s preview?
- Does WP Have a Function To Generate .htaccess RewriteCond?
- Changing bloginfo description from a plugin
- wp_enqueue_style built in styles
- Override pluggable functions in a plugin?
- WordPress Plugin Setting’s POST
- How do I create a custom api endpoint?
- Add tab to profile.php wordpress plugin development
- Sharing a common set of image files for media library, across all sites within multisite
- wp_localize_script and host/browser cache
- Plugin update not reflected in WordPress plugin page
- Get a custom table to an array
- How do I alter the comment form ‘allowed tags’ text in a plugin?
- Error : “Cannot use object of type WP_Post as array in”
- Replacing Scripts in Admin Load_Scripts
- How to filter content on Save/Publish to add rel=”nofollow” to all external links?
- How to show active version on wordpress.org of a published plugin?
- How to create database table, add data, update and delete using wpdb via plugins?
- Find out Requires WP tag for a plugin when submitting it
- Extending theme PHP class in plugin
- Any ideas to trigger some code after plugin update?
- WP_Query filters
- Plugin Architecture Question: How to avoid using transients
- WP Editor Issue in Backend
- SSL certificate verify failed
- How to test plugin update through WordPress plugin updater without tagging new release in the repo
- How to load library scripts in admin from plugins in noConflict wrapper?
- rest_no_route on custom API endpoint wordpress
- WP and object persistence (or lack thereof)
- UWooCommerce – add cart discount programmatically?
- Additional classes `undefined` after saving post in Gutenberg
- How do you submit a Gutenberg plugin?
- Bad Request in AJAX
- Remove sidebar on single page using plugin API
- When does save_post hook fire on post save/update
- Enqueuing scripts and styles in custom plugins
- Include file in plugin file
- WP nonce field checkbox prints checked=’checked’ outside input field
- Shortcode not appearing when used as post content in wp_insert_post() or possibly, shortcode not being registered at all
- Creating two tables in database on activation hook
- Adding custom stylesheet into header.php using a plugin
- Developing the save function in Gutenberg blocks
- Detect change in site_url and home_url
- Adding Custom CSS with PHP
- How to remove/replace current page template?
- How to receive notification of deprecated API elements and functions?
- Using password protection to load different page elements?
- It is possible to pass $args that sent by add_settings_field() inside another function?
- Change reminder email date to 14 days before
- .htaccess with WordPress – create my own pretty url with parameters (above WordPress settings)
- Generating a password-protected front-end page via a plugin
- How do I add a 5 digit ZIP code validation to a Contact7 form?
- Can’t upload image via submitting custom post from frontend
- Need Help to make a logic for editing posts in Frontend
- WordPress: I wanted to use Add rewrite rule multiple times for multiple CPT in my plugin
- PHPUnit Testing and woocommerce Constant
- WordPress Query doesn’t return the correct value
- Uncaught Error: Call to undefined function wp_get_current_user() in
- How do I show how many products are remaining from the bought package
- Group By in a Metaquery
- wp_ajax function return the html page
- Where to store Plugin specific information in the database
- How to force download a plugin generated file?
- Upload images to custom database table in admin backend
- Adding admin for specific users
- Developing a plugin where users can edit entries saved in database
- How to create session for user which is not an admin user
- Any way to make Apache’s internal redirect work?
- New Users are saved with no role selected
- get_option() is undefined in TinymceWindowManager
- Getting duplicate page when activating my plugin
- Modify request query string before plugins
- Plugin error on activation – breaks page encoding and prints the code of plugin php files
- Attach an image to new posts
- wordpress plugins with add-ons
- WordPress Plugin default option
- how to insert content into wp_head after loop_end
- oneOf two possible objects in WP REST API?
- WordPress simple ‘Hello World’ plugin – problems