我目前正在使用Rhythm主题在Wordpress网站上工作 - 它的默认模板在页脚中内置了四列,我想只有三个。
所以在我的孩子主题中,我进入了widget部分并从php代码中删除了一列,所以它看起来像这样:
if (ts_get_opt('footer-widgets-enable') == 1): ?>
<!-- Divider -->
<hr class="mt-0 mb-0"/>
<!-- End Divider -->
<!-- Widgets Section -->
<section class="footer-sidebar page-section">
<div class="container relative">
<div class="row multi-columns-row">
<div class="col-sm-8 col-md-4 col-lg-4">
<?php if (is_active_sidebar( ts_get_custom_sidebar('footer-1', 'footer-sidebar-1') )): ?>
<?php dynamic_sidebar( ts_get_custom_sidebar('footer-1', 'footer-sidebar-1') ); ?>
<?php endif; ?>
</div>
<div class="col-sm-8 col-md-4 col-lg-4">
<?php if (is_active_sidebar( ts_get_custom_sidebar('footer-2', 'footer-sidebar-2') )): ?>
<?php dynamic_sidebar( ts_get_custom_sidebar('footer-2', 'footer-sidebar-2') ); ?>
<?php endif; ?>
</div>
<div class="col-sm-8 col-md-4 col-lg-4">
<?php if (is_active_sidebar( ts_get_custom_sidebar('footer-3', 'footer-sidebar-3') )): ?>
<?php dynamic_sidebar( ts_get_custom_sidebar('footer-3', 'footer-sidebar-3') ); ?>
<?php endif; ?>
</div>
</div>
</div>
</section>
<!-- End Widgets Section -->
我遇到的问题是页面仍在引用带有四列的代码。因此,我猜测我的问题出在我的footer.php文件或template-parts.php文件中,并且它没有指向正确的文件。
我最担心的是我没有正确设置我的孩子主题,现在编码试图引用两个不同的主题。