Override plugin styles via my custom theme

So as not to rewrite the plugin interface styles or modify the current ones, I want to add new styles for this plugin through my theme, for this I need to disable them, I do this through: remove_filters_with_method_name

remove_filters_with_method_name( 'wp_enqueue_scripts', 'register_plugin_assets', 10 );

now how can I use my custom css in such a way that the plugin can get them?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Plugins don’t need to “get” styles. You just need to enqueue your own stylesheet with styles for the markup used by that plugin. If the plugin is on the front-end, your styles could even just be added to your child theme, or Appearance > Customize > Additional CSS. If the plugin elements you want to style are in the admin, just enqueue your stylesheet with admin_enqueue_scripts.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x