• Resolved jdewit

    (@jdewit)


    I want to replace the storefront version of woocommerce.css with one in my child theme. The documentation describes three ways to dequeue storefront woocommerce styles but none of them work for me. I tried:

    add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );
    
    add_filter( 'woocommerce_enqueue_styles', 'jk_dequeue_styles' );
    function jk_dequeue_styles( $enqueue_styles ) {
    	unset( $enqueue_styles['woocommerce-general'] );	
    	return $enqueue_styles;
    }
    
    add_filter( 'woocommerce_enqueue_styles', '__return_false' );

    I also tried it the WordPress way with:

    wp_dequeue_style( 'storefront-woocommerce-style' );

    but the file themes/storefront/assets/sass/woocommerce/woocommerce.css is still loaded.

    • This topic was modified 8 years, 1 month ago by jdewit.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Something similar happens to me, I have correctly installed my son theme, but I can not get the documents that are inside the INC folder to work, they are simply ignored and only those of the parent theme are valid, if you can tell us what we can do it would be very helpful

    Joel Williams

    (@joelwills)

    Automattic Happiness Engineer

    Hi there!

    Try

    function remove_sfwccss() {
        wp_dequeue_style( 'storefront-woocommerce-style    ' );
        wp_deregister_style( 'storefront-woocommerce-style' );
    }
    
    add_action( 'wp_enqueue_scripts', 'remove_sfwccss', 100 );

    I’ve tested that and that will remove the woocommerce.css from loading.

    Hope that helps!

    Thread Starter jdewit

    (@jdewit)

    That worked. Thank you @joelwills.

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

The topic ‘child theme woocommerce css’ is closed to new replies.