Nesoor
Nesoor

Reputation: 13

Wordpress child theme css priority

I edited my Wordpress style.css in the child theme folder but the CSS is not overriding unless I uses !important on everything.

How can I set the child theme style.css to a higher priority. I already searched on Google and tried multiple solutions but somehow I don't get it working.

Upvotes: 0

Views: 717

Answers (1)

user2407400
user2407400

Reputation: 233

Try dequeueing the child CSS in the child theme's functions.php and then enqueuing it with the parent theme's CSS as a dependency.

https://codex.wordpress.org/Function_Reference/wp_dequeue_style https://developer.wordpress.org/reference/functions/wp_register_style/

Upvotes: 1

Related Questions