Overriding WooCommerce CSS
-
I’ve seen this subject in previous questions but so far the solutions I’ve seen haven’t helped me.
I am using a child theme with its own style.css file.
I know you can completely disable all the WooCommerce styles (from here) but I was hoping I wouldn’t have to do that. I’d like to be able to just add overriding styles to my child theme’s stylesheet, like it says you can on that page, but no matter what I do, the styles don’t override the WooCommerce styles, even if I use !important.
One of the things I saw in a couple of previous questions was the possibility of queueing the child theme’s stylesheet AFTER the WooCommerce stylesheet is loaded, and that way they’d be overridden, but I can’t figure out how to do that with my setup. My child theme’s functions.php has this:
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array('parent-style') ); }which loads the child theme’s stylesheet. Is there something I can add here to change the priority of the stylesheet, so that it loads AFTER the WooCommerce stylesheet?
Like I said, I was hoping I wouldn’t have to disable the WC styles and redo them all from scratch.
The topic ‘Overriding WooCommerce CSS’ is closed to new replies.