w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Why are my style.css updates reflected only when performing a hard refresh, reverting to a previous version when refreshing afterwards?

Which method are you using to load your child-theme's css file?? If you are using a link to include your child css as

<link rel="" ..............> then try appending the
version at the end of you file name 

<link rel="stylesheed"...... href="your_child_style.css?v-=1.10">
where ?v=1.10 is the version number. Every time you update your css
increase the version number(In case you don't want to change the version
every time i suggest you use the php time() function to generate a unique
number eveytime the css is loaded)

If your css file is loaded automatically then make sure you have version decalared in you css file as

/*
Theme Name: yourchildtheme
Version: 1.2

*/

Try to change the version and it will work just fine. Good luck

add_action( 'wp_enqueue_scripts', 'my_child_theme_scripts' );
function my_child_theme_scripts() {
 wp_enqueue_style( 'parent-theme-css', get_template_directory_uri() .
'/style.css' );
}




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.