Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 编辑一个';侧边栏';在Wordpress中_Php_Html_Wordpress - Fatal编程技术网

Php 编辑一个';侧边栏';在Wordpress中

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 ?>

我的wordpress页面似乎有问题,因为小部件没有显示,但我不确定如何编辑小部件

在外观>编辑器下的homepage.php上的代码是

<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')