woocommerce / theme-customisations

313 stars 112 forks source link

Force update cache version of style.css #22

Open juanmafont opened 6 years ago

juanmafont commented 6 years ago

I have a problem.

I delete cache into chromiun and firefox, press F5, press CTRL+R , etc..., but file my file https://mydomain.es/wp-content/plugins/theme-customisations/custom/style.css?ver=4.9.5 is always loading the same (except with new devices), and I made changes on it ( when I download with cpanel the css file is correct, has the changes) if I try to change manually the option 'ver=' like:
https://mydomain.es/wp-content/plugins/theme-customisations/custom/style.css?ver=4.9.6

then the file is loaded with changes

What is the correct way to force load last style.css file ?

I have read this: https://wordpress.stackexchange.com/questions/90820/how-to-add-version-of-style-css-in-wordpress but not sure if I have to change wp_enqueue_style() command into my

/public_html/test/wp-content/plugins/theme-customisations/theme-customisations.php

I have modify theme-customisations.php

/**
* Enqueue the CSS
 *
 * @return void
 */
public function theme_customisations_css() {
    wp_enqueue_style( 'custom-css', plugins_url( '/custom/style.css', __FILE__ ),array(),rand() );
}

and now all ok, the changes into styles.css is always reloaded, but
is this the correct way ?