Php 编辑一个';侧边栏';在Wordpress中
我的wordpress页面似乎有问题,因为小部件没有显示,但我不确定如何编辑小部件 在外观>编辑器下的homepage.php上的代码是Php 编辑一个';侧边栏';在Wordpress中,php,html,wordpress,Php,Html,Wordpress,我的wordpress页面似乎有问题,因为小部件没有显示,但我不确定如何编辑小部件 在外观>编辑器下的homepage.php上的代码是 <section class="row post_content"> <div class="col-sm-8"> <?php the_content(); ?> </div> <?php get_sidebar('sidebar2'); // sidebar 2 ?>
<section class="row post_content">
<div class="col-sm-8">
<?php the_content(); ?>
</div>
<?php get_sidebar('sidebar2'); // sidebar 2 ?>
</section> <!-- end article header -->
我在哪里可以找到“侧边栏2”的代码,因为此时页面上出现错误消息,侧边栏应显示,如开发人员手册中所述,您的侧边栏文件应称为
sidebar-sidebar2.php
。此文件将出现在活动主题的根目录中
get_sidebar()
钩子允许使用特定的侧栏模板文件代替默认的侧栏模板文件。如果文件名为sidebar-new.php,则在钩子中指定文件名为get_sidebar('new')