WordPress wooCommerce.css parent / child issue (Uncode and uncode-child)

Viewed 37

Looked around and haven't found a complete answer so asking again:

Succinctly: as long as the filename of the wooCommerce.css file in the Uncode folder remained unchanged ... it overwrites the file of the same name in the uncode-child folder. Only if I alter the name of the file in the Uncode folder, then the one is the Uncode-Child folder will be used. How do I overcome this? Thank you for your help.

More Verbose: a) Using the Uncode theme, beneath the structure: uncode -> library -> css there is a wooCommerce.css file b) Under uncode-child (in the top of the folder) is a wooCommerce.css file

What I want to do is to use the b) style ... however, I find that when the file in a) exists, and shares the same name, that it ovverrides the uncode-child (b) file. Only if I rename the (a) file, does the page displays the child style I want.

In the uncode-child folder (at the top of the structure) I have a "functions.php" file. In that file is the following code --> the initial code was already in there and the second function is what I wrote (without the second function, the uncode-child -> wooCommerce.css will not work regardless of name change in the parent folder)

function theme_enqueue_styles()
{
    $production_mode = ot_get_option('_uncode_production');
    $resources_version = ($production_mode === 'on') ? null : rand();
    $parent_style = 'uncode-style';
    $child_style = array('uncode-custom-style');
    wp_enqueue_style($parent_style, get_template_directory_uri() . '/library/css/style.css', array(), $resources_version);
    wp_enqueue_style('child-style', get_stylesheet_directory_uri() . '/style.css', $child_style, $resources_version);
}



function enqueue_my_custom_styles() {
    wp_enqueue_style( 'woocommerce', 'https://donationsorg.wpengine.com/wp-content/themes/uncode-child/woocommerce.css', false ); 
}
0 Answers
Related