• Hi guys.
    I try to override woocommerce.css, by following this guide:

    However, after creating folder /storefront-child/css/woocommerce.css
    the override is still not working. My functions.php is put in /storefront-child/ – and contains the following php code to the inclusion of the custom stylesheet. Can you see were it goes wrong?

    ——————–
    <?php

    add_action( ‘wp_enqueue_scripts’, ‘enqueue_parent_theme_style’ );
    function enqueue_parent_theme_style() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri().’/style.css’ );
    }

    // Disable WooCommerce’s Default Stylesheets

    // Disable the stylesheets below via unset():
    unset( $styles[‘woocommerce-general’] ); // Styling of buttons, dropdowns, etc.
    unset( $styles[‘woocommerce-layout’] ); // Layout for columns, positioning.
    unset( $styles[‘woocommerce-smallscreen’] ); // Responsive design for mobile devices.

    return $styles;

    add_action(‘woocommerce_enqueue_styles’, ‘disable_woocommerce_default_css’);

    // Add a custom stylesheet to replace woocommerce.css
    function use_woocommerce_custom_css() {
    // Custom CSS file located in [Theme]/css/woocommerce.css
    wp_enqueue_style(
    ‘woocommerce-custom’,
    get_template_directory_uri() . ‘/css/woocommerce.css’
    );
    }
    add_action(‘wp_enqueue_scripts’, ‘use_woocommerce_custom_css’, 15);

    ————————-

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

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Problems overwriting woocommerce parent styles’ is closed to new replies.