【发布时间】:2021-03-09 00:03:40
【问题描述】:
我有一个问题 - 我的 footer.php 文件包含这样一个函数:
<?php adios_footer_template(adios_get_opt('footer-template')); ?>
我认为代码正在调用一些内部函数。当我深入研究主题代码时,我发现这个函数有以下代码:
function adios_footer_template($layout) {
if(class_exists('ReduxFramework') && !adios_get_opt('footer-enable-switch')) { return; }
switch ($layout) {
case 'footer-style5':
get_template_part('templates/footer/footer-style5');
break;
case 'footer-style4':
get_template_part('templates/footer/footer-style4');
break;
case 'footer-style3':
get_template_part('templates/footer/footer-style3');
break;
case 'alternative':
get_template_part('templates/footer/alternative');
break;
case 'default':
default:
get_template_part('templates/footer/default');
break;
}
}
我想要实现的是或通过子主题添加一个案例并使其工作,或者至少有一个选项来编辑这些页脚样式。我尝试将整个模板/页脚目录复制到子主题中,然后添加更改(没有成功;在前端没有任何改变)。然后我什至尝试重命名该函数并将其粘贴到我自己的functions.php中,但同样 - 没有改变任何东西。它甚至可行吗?
【问题讨论】:
-
我显然知道,但你检查过 adios_get_opt("footer-enable-switch is enabled") 吗?
-
是的,我已经检查过:)
标签: php wordpress function themes