There is a blog on Wordpress 3.2.1 There was a situation when, after changing the style file in the template, the styles on the blog did not change. Caching plugins are not used, the browser cache has been cleaned several times, it does not help, the server restart also did not help. For the sake of experiment, I deleted the css file from the server, the old styles are still displayed. Who faced a similar problem prompt how to solve it. Thank you in advance.

  • And you did not try to look in the browser, what styles work and what files are they in? - Zhukov Roman
  • Naturally tried. But it's not that. Even with the complete removal of the css file, the site design does not change, when viewing the source code in the browser, the style file is displayed and read, although in reality it is not on the server. I understand that this is in the cache, but Wordpress does not cache site files by default. The point is likely to be server caching. But the hoster claims to have disabled the cache and rebooted the server. I do not even know where to look for the cause in such a situation. - 2Gareen

4 answers 4

No need to wait. Most likely you have in htaccess caching for browsers. In order for the browser to understand that the style is different, just put a question mark and some parameter in the style loading in the template after the file name. I usually put a number. it turns out like this:

 <link rel="stylesheet" type="text/css" href="/css/ie6.css"/> 

has become

 <link rel="stylesheet" type="text/css" href="/css/ie6.css?1"/> 
  • <link rel = "stylesheet" type = "text / css" href = "/ css / ie6.css? 1" /> this option really helped me, thanks to the author for the useful information! ;-) Happy New Year to all! :-) - user16573

Try to wait. I have about half a day or so going out so that the CSS is updated and appears normally.

Just to check that everything is displayed normally, you can try to use servers through which you can see how your site is visible on other browsers.

But I don’t know how to solve the problem itself so that it is updated right away.

    Chopping off the cache, renaming links to styles, we have already tried. There is no htaccess on the site, due to the fact that the server works under iis.

    The problem was solved in an unexpected way. Due to the lack of disk space, the admins moved the sites to another server with a bigger screw, interrupted the links in the config, but apparently not all. Blog on WordPress stayed with the old link. We uploaded all the updates to the new server, and the site on the network was displayed with a copy on the old server. Since the database was on a separate server, posts could be published from both copies. So the cause of the problem is in the human factor.

      I generally removed the version in the style file through the connection of styles in functions.php , specifying null third parameter.

       wp_enqueue_style( 'child_style', trailingslashit( get_stylesheet_directory_uri() ) . 'style.css', array( 'parent_style' ), null ); 

      You can specify your version instead of null