【问题标题】:Duplicate style.css in wordpress在 wordpress 中重复 style.css
【发布时间】:2017-03-03 07:31:02
【问题描述】:

我有一个带有版本的 style.css 的链接,每次在服务器上更改我的主题中的文件后都会更新:

 <link rel="stylesheet" type="text/css" media="all" href="http://example.com/wp-content/themes/twentythirteen/style.css?v=1477025590" />

另外,我可以在代码源中看到另一个指向相同 style.css 的链接,但旧版本不会自动更改(它是主题的标准链接):

<link rel='stylesheet' id='twentythirteen-style-css'  href='example.com/wp-content/themes/twentythirteen/style.css?ver=2013-07-18' type='text/css' media='all' />

正常吗?用户应该加载一个文件两次,或者我可以通过functions.php以某种方式删除第二个链接?

【问题讨论】:

  • 是的,你需要检查你的functions.php这个css加载两次吗?你可以在那里找到 wp_enque_style 函数
  • 谢谢!在functions.php中找到这一行
  • 欢迎继续帮助 :)

标签: wordpress hyperlink styles loading


【解决方案1】:

是的,你需要检查你的functions.php是否有这个css加载 两次?你可以在那里找到 wp_enque_style 函数。

从那里删除加载两次的 css 将解决您的错误

【讨论】:

  • 这是 wp_enqueue_style 不是 wp_enque_style ;)
猜你喜欢
  • 2012-06-05
  • 1970-01-01
  • 2018-08-19
  • 2014-01-31
  • 1970-01-01
  • 2021-02-14
  • 2016-08-09
  • 2014-08-21
  • 2013-06-18
相关资源
最近更新 更多