【问题标题】:Re-ordering sections in a free wordpress theme在免费的 wordpress 主题中重新排序部分
【发布时间】:2018-09-26 00:20:02
【问题描述】:

每当我尝试将此代码放在子主题中时,它总是给我这个错误。 Rollback error(?)

【问题讨论】:

  • 所以改函数名?
  • 我之前更改了子主题中的函数名称,但它没有更改任何内容或有时它不会加载站点

标签: php wordpress wordpress-theming


【解决方案1】:

您需要使父主题中的功能可插入。

<?php
if ( ! function_exists ( 'my_function' ) ) {
function my_function() {
    // Contents of your function here.
}
}
?>

这样,如果孩子中存在相同的功能,则跳过它。但是,如果您根本不想更改父主题,还有其他选项。请让我知道,我会发布它们,但是这个选项是最简单的。

【讨论】:

  • 太棒了!乐于助人
猜你喜欢
  • 2020-09-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-01-21
  • 1970-01-01
  • 2021-11-24
相关资源
最近更新 更多