【发布时间】:2016-05-12 14:54:15
【问题描述】:
我为我的模板页脚创建了 5 个小部件部分。现在我想知道,如何使页脚部分仅在我的首页主题和所有其他页面中的其他小部件中可见?所以 footer 5 小部件出现在首页,而 footer4 出现在其他页面!
这是我写的,但它不起作用!
<?php if (is_home()): if ( function_exists('dynamic_sidebar') && dynamic_sidebar(is_active_sidebar('footer5'))){?>
<div class="col-xs-12 col-sm-6 col-md-3">
<?php get_dynamic_sidebar('footer5'); ?>
</div><?php }?>
<?php elseif(is_active_sidebar('footer4')) : ?>
<div class="col-xs-12 col-sm-6 col-md-3 socialiconsfooter">
<?php dynamic_sidebar('footer4'); ?>
</div><?php endif; ?>
【问题讨论】:
标签: php wordpress wordpress-theming