Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/276.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
sidebar.php文件中的注释代码错误_Php_Sidebar - Fatal编程技术网

sidebar.php文件中的注释代码错误

sidebar.php文件中的注释代码错误,php,sidebar,Php,Sidebar,我试图在我的wordpress主题中隐藏一个边栏小部件。我已经完成了帮助站点在sidebar.php文件中建议的操作。但是当我添加一个新页面时,我得到一个解析错误,在页面右侧边栏应该是这样的: 分析错误:语法错误,意外的“endif”(T_endif),第18行的C:\xampp\htdocs\Rustic1\wp content\themes\restau\sidebar.php中应为文件结尾 我希望从整个主题中删除侧栏。在注释和下一个 您的html端使用php代码。所以你得到了这个错误。

我试图在我的wordpress主题中隐藏一个边栏小部件。我已经完成了帮助站点在sidebar.php文件中建议的操作。但是当我添加一个新页面时,我得到一个解析错误,在页面右侧边栏应该是这样的:

分析错误:语法错误,意外的“endif”(T_endif),第18行的C:\xampp\htdocs\Rustic1\wp content\themes\restau\sidebar.php中应为文件结尾



我希望从整个主题中删除侧栏。

在注释和下一个


您的html端使用php代码。所以你得到了这个错误。请检查您是否有
谢谢您提供的信息,我更改了文件,但现在出现了以下错误:解析错误:语法错误,意外的“endif”(T_endif),第18行的C:\xampp\htdocs\Rustic1\wp content\themes\restau\sidebar.php中的文件结尾
endif
if
不匹配。您好,可以详细说明吗?我不熟悉编码,谢谢
<?php
/**
 * The sidebar containing the main widget area.
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package Restau
 */
?><div id="sidebar">
 <!-- Start widget comment>
 <?php
if ( ! is_active_sidebar( 'sidebar-1' ) ) {
    return;
}
?>
<aside id="sidebar" class="col-md-4 widget-area" role="complementary">
<?php dynamic_sidebar( 'sidebar-1' ); ?>
<?php endif; ?>
<End widget comment -->
</div>
</aside><!-- #sidebar -->
<?php
/**
 * The sidebar containing the main widget area.
 *
 * @link https://developer.wordpress.org/themes/basics/template-    files/#template-partials
 *
 * @package Restau
 */
?>
<div id="sidebar">
 <!-- Start widget comment
 <?php