My approach is to follow the CSS cascade principle. So basically the one that loads the last will override the previous rules, if not defined ! Important
Check here:
//This is the order the css load by default, at leat on the sites I have worked!!! <link rel="stylesheet" href="http:/css/custom_styles.css" type="text/css" media="all"> <link rel="stylesheet" href="http:/css/woocomerce.css" type="text/css" media="all">
So what is the idea Download your custom CSS after loading woocommerce.
Method 1 : add a low priority to [add_action] for the add_action style:
function load_my_css(){ wp_enqueue_style('custom-theme', URL TO STYLE); }
Method 2 Remove the woocommerce styles so that you create your own styles.
// Or just remove them all in one line add_filter( 'woocommerce_enqueue_styles', '__return_false' );
Method 3 : add an array of dependencies to your own style
function load_my_css(){ wp_enqueue_style('custom-theme', URL TO STYLE, array(DEPENDECIES HERE)); }
Hope one of the methods helps.
source share