skip to Main Content

When I updated the style.css in Appearance > Theme Editor > stylesheet(style.css),
I refresh my site, then I see that the style is not applied.

I’ve also tried clear cache in browser and use cmd + shift + r to re-download the resources but still not working.

Is there any way to make the site live for development, or is there any preferred way for development?

In style.css

...
/*
Author: xxx Limited
Description: This is the template for xxx
Version: 1.0.0. // tried to update the version here but not working
... 
*/
.....

3

Answers


  1. Need to check few things.

    1. upload style.css through ftp or cpanel again to check whether it is properly saved or not,

    2. Remove cache , check in private window to make sure that there is no cache.

    3. check in console for error if above 2 doesn’t work.

    Login or Signup to reply.
  2. If the CSS file has been updated, the problem is because of caching. There are different levels of cache.

    • Clear Cloudflare cache if you are using it.
    • Clear any caching mechanism that your Webhosting offered.
    • Clear all plugins cache
    Login or Signup to reply.
  3. Salman and PHP Geek are right, do the steps they mention that should solve your problem. If the problem continues then…

    In function.php find wp_enqueue_style function it would look something like this. There can be multiples of them so look for the ‘style.css’ inside them

    wp_enqueue_style('yourtheme-style', get_template_directory_uri() . '/style.css', '', '1.1.0');

    see the last argument ‘1.1.0’ this could be anything on your case, this can also be a variable. Change this to something else like ‘1.1.1’ (anything other then 1.1.0)

    OR

    replace the line with the below code (doing this will change your version automatically whenever you change something in the style.css)

    $ver = filemtime(get_template_directory().'/style.css');
    wp_enqueue_style('yourtheme-style', get_template_directory_uri() . '/style.css', '', $ver);
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search