为什么旧版本的 style.css 与我的 Wordpress 子主题中的活动版本冲突?

发布于 2025-01-19 13:16:12 字数 638 浏览 1 评论 0原文

我有一个问题从一开始就一直困扰着我的项目。我的子主题中的旧版本 style.css 似乎与活动版本冲突。

例如,在之前的迭代中,我有一个最大宽度为 150 px 的类“.facet-sort”。当我删除最大宽度规则但页面样式没有改变时。当我检查源代码时,我仍然可以看到该规则。然而,当我检查子主题文件夹中的 style.css 页面时,我可以确认该规则确实已被删除。

使用 Firefox 页面检查器进一步检查后,我发现旧版本的样式表仍然处于活动状态并应用于页面(参见下图)。

这不是与父主题中的 style.css 冲突的结果,因为我可以看到这些是上传到我的子主题的早期版本样式表中的旧类。

我想这一定是缓存的结果。我已经尝试清除网站上的所有缓存。我还联系了我的托管提供商的技术服务,并与他们确认所有缓存都已被刷新。但无济于事。

如果您能提供任何建议,我将不胜感激。

来自 Firefox Page Inspector 的图像

来自 Firefox 检查器样式表的图像

I have a problem that has been plaguing my project from the beginning. It seems that old versions of style.css in my child theme are conflicting with the active version.

For example, in previous iterations, i had a class ".facet-sort" with a max-width of 150 px. When I delete the max-width rule but the page styling doesn't change. When I inspect the source code, I can still see that rule. Yet when I check the style.css page in my child theme folder, I can confirm that that rule has indeed been deleted.

Upon further inspection with the Firefox page inspector I found older versions of the stylesheet that are still active and being applied to the page (see images below).

It is not the result of a conflict with style.css in the parent theme since I can see that these are old classes from an earlier version of the stylesheet uploaded to my child theme.

I guess it must be the result of caching. Ive tried clearing all of the caches on the site. Ive also contacted the technical service of my hosting provider and confirmed with them that all caches have been flushed. But to no avail.

I would appreciate any advice you can offer.

Image from Firefox Page Inspector

Image from Firefox Inspector Stylesheets

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文