• Resolved cmcl

    (@cmcl)


    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.

    https://wordpress.org/plugins/woocommerce/

Viewing 3 replies - 1 through 3 (of 3 total)
  • I was wondering the same thing, or some way override some of the styles.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Can you use more specific selectors?

    I had the same problem with a site I’m developing and I believe it’s because this theme is based in Genesis. (I’ve used other frameworks and CSS overrides work fine). So I’ve used a more specific selector and that’s work. Thanks @andrew

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Overriding WooCommerce CSS’ is closed to new replies.