更新样式后。css输入Appearance > Theme Editor > stylesheet(style.css)
, 我刷新了我的站点,然后发现没有应用该样式。
我还尝试清除浏览器缓存并使用cmd + shift + r
重新下载资源,但仍不起作用。
我没有启用Cdn。
是否有任何方法可以使该网站为发展而生存,或者有任何首选的发展方式?
在里面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
...
*/
.....
SO网友:cjbj
这很可能是服务器端的缓存问题。签入您的functions.php
如果样式表是enqueued 使用版本号。未能做到这一点是WordPress缓存插件忽略更新的最常见原因style.css
. 它应该看起来有点像这样:
$theme_data = wp_get_theme();
wp_enqueue_style(\'main-style\', get_template_directory_uri() . \'/style.css\', \'\', $theme_data[\'version\'], \'all\');
否则,可能是Web服务器软件正在快速缓存。在这种情况下,等待几个小时可能是你唯一的办法。