You can make sure that your CSS is enqueued after your theme’s CSS and also make sure that your CSS is using rules that are more specific. This will help in making your CSS override the theme’s CSS.
Worse-case scenario you could add !important to a few CSS rules if you are having a hard time overriding your theme.
When you use wp_enqueue_style you should use the wp_enqueue_scripts hook, it offers a priority parameter. Here is an example.
function wpse_my_plugin_styles() {
$plugin_url = plugin_dir_url( __FILE__ );
wp_enqueue_style( 'my_styles', $plugin_url . "/css/style.css");
}
add_action('wp_enqueue_scripts', 'wpse_my_plugin_styles', 999);
You could also create a child theme. This would allow you to customize the CSS however you want and not worry about it getting wiped out if the plugin updates.
Related Posts:
- how to include other plugins css files in a shortcode?
- All shortcodes not working on custom theme
- Make the css of the widget overwrite theme css
- Layout shop page: resize images and columns
- How extend shortcode default values for a plugin?
- ‘Customize’ button in admin bar for CSS
- How to generate CSS from a shortcode within a plugin
- Custom CSS for plugin form
- plugin style conflicts, how to override? [closed]
- How to disable CSS rule in Twentythirteen style.css?
- Plugin Handle URL With Custom Theme
- Globally register styles but enqueue them selectively
- Can someone please tell me what is wrong with my plugin?
- Child Pages Short Code plug-in and hover capabilities?
- Redirect to another page using contact form 7? [closed]
- Where are theme codes located for WordPress?
- using do_shortcode
- How to add a dvi tag to a shortcode then change a generated text using jQuery
- How to activate a plugin on the activation of a theme?
- Making that Admin Bar transparent or a blue color
- How to make a dynamic css class whose name changes every visit to confuse scraper
- Blocking Plugin Css to load custom in template directory
- Load CSS files in header of Bones theme?
- How do I work with the SlideDeck plug-in?
- uncaught TypeError: Cannot read properties of null (reading ‘classList’) custom plugin
- Custom Plugin scripts from admin working in frontend
- how to display a template.php in a shortcode
- Image path in childs theme
- WP Plugin CSS not being applied to page
- how to add custom css at top above all css file for specific url
- Speed issues because of CSS & JavaScript
- Child Theme Changes Are Not Reflecting In Parent Theme
- do_shortcodes() isn’t working
- WP Customer Reviews call short code on another page [closed]
- Adding CSS to custom post type admin page causes error
- Create shortcode to echo javascript
- Namespaced shortcode?
- Edit External CSS
- Why Do I get “wp_remote-get: could not handle for fopen()”?
- How to check if my wordpress websiste is nulled or not?
- Remove specific plugins and themes from the Dashboard->Updates page [duplicate]
- Combining several CSS files into one for optimization
- Theme Custom Pages
- Shortcode does not expand in Facebook like
- How to get theme’s info from wordpress.org/themes using api.wordpress.org?
- Is there a way to remove a tooltip of a plugin via custom CSS? [closed]
- strange shortcode error: does shortcodes requires any dependency?
- How can I use my custom wordpress theme on two websites? [closed]
- Can I filter a function created by a theme or a plugin?
- wp_localize_script not passing the data
- Get post content from outside the loop with plugin shortcode usability
- Custom CSS not being added by plugin
- How to check homepage contain blog post?
- plugin inside a wordpress theme
- Create Short code dynamically
- Get variable value based on string constant
- Share plugins, themes, and multi post in a multidomain network
- Removing the custom_image_header from wp_head
- Gantry Framework: new page loads homepage content instead of page content
- Upgrade not working & themes not supporting
- use EDD Content Restriction for restricting php in template
- Unable to locate inline CSS causing parts of page to be blank
- Two plugins using the same CSS id
- Load CSS before Theme CSS
- WordPress load same script two times
- Elementor pro page editing gives error There has been a critical error on this website. Please check your site admin email inbox for instructions
- Get a value from a shortcode for another function
- How to call function in WordPress on button click?
- Hide content for specific users with id
- What plugin would make this happen? If is the theme
- WordPress site hamburger menu toggle not working
- using WPPB shortcodes without the plugin
- WordPress wp get_temp_dir return non exiting folder, thus failing plugin & themes update
- when i activate my WordPress plugin cannot see customizer options or preview
- Writing SEO for Homepage when homepage is set to display latest posts
- save short-code in my custom plugin settings problem missed something
- Getting unknown text in footer of email
- Description: Too much time has passed without sending any data for document
- How can I make the search bar in my wordpress site search all of the pages rather than just the blog posts?
- Meta box or shortcode help
- Call/Run a Mathematica (.m) Shell Script from WordPress Page/Blog
- How to use shortcode of any plugin to show it visually where i want?
- Issues with Post 2 Post Plugin
- Need to change contact email depending where user is from
- Overwrite CSS of Instaemail plugin popup
- contact 7 plugin stops some pages from working properly
- Disqus plugin outputs script as literal text
- Trouble After Update, Removing Plugin
- Pulling RSS from site and display it in posts
- How to get current template file used by WordPress?
- Plugins to generate CSS Sprites? [closed]
- Shortcode return is printing a 1 afterward
- How to make wordpress backend mobile optimized.?
- Display HTML5 jQuery Audio Player On Front Page
- Invalid argument supplied for foreach()
- Beginner question: Accessing js script in plugin
- thumbnail_width not working in wordpress most popular post plugin
- Display file contents within Plugin
- Newspaper theme, custom query vars, & custom rewrite rules
- Sudden ERR_HTTP2_PROTOCOL_ERROR on every JS and CSS files loads