CSS在生产服务器上没有生效(Bitbucket存储库)

huangapple go评论72阅读模式
英文:

CSS changes not taking effect on production server (Bitbucket repo)

问题

我有一个托管在Linux服务器上并连接到Bitbucket仓库的WordPress网站,但CSS更改不会立即反映在实际网站上。

我对HTML代码和样式表进行了更改。但是,当进行推送时,HTML代码会立即更新,但样式表在很长一段时间内不会更新(不要误解,样式表在GIT仓库上更新,但网站不会立即反映这些更改,需要大约4-5小时)。

我尝试通过WP-Rocket插件、Cloudflare、浏览器缓存/cookies清除缓存,但都没有用。昨天我所做的更改今天才显示出来,而我今天所做的更改仍然没有显示。

如果有任何信息我可以提供,请告诉我。我最近在Linux服务器上配置了这个GIT仓库。

英文:

I have a WordPress website hosted on a Linux server and connected to a Bitbucket repository and the CSS changes do not reflect on the live website.

I made changes to the HTML code and style sheet. However, when the changes are pushed, the HTML code updates instantly, but the stylesheet does not update for the longest time (Do not get me wrong here, the stylesheet updates on the GIT repo but the website does not reflect these changes immediately, takes around 4-5 hours).

I tried clearing Cache through WP-rocket plugin, Cloudflare, browser cache/cookies, nothing works. Changes that I made yesterday came up today and the changes that I made today are still not showing.

If there are any information that I can give please do let me know. I recently configured this GIT repository in the linux server.

答案1

得分: 0

请在function.php中检查脚本和样式的加载位置,应该是"rand(111,9999)"。例如,自定义CSS文件必须是get_template_directory_uri() . '/inc/custom.css',数组,rand(111,9999));

英文:

Please also check in function.php where enqueue scripts and styles, should be "rand(111,9999)". For example, custom css file have to be get_template_directory_uri() . '/inc/custom.css', array(), rand(111,9999) );

huangapple
  • 本文由 发表于 2023年1月6日 10:45:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/75026450.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定