【发布时间】:2012-01-28 16:30:12
【问题描述】:
我正在创建一个 WP 主题,但遇到了问题。我想拥有带有小部件的动态侧边栏,因此像这样创建了 sidebar.php
<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar()) : ?>
<?php endif; ?>
我在functions.php中写了这个
<?php
if (function_exists('register_sidebar'))
register_sidebar();
?>
现在,wordpress 在“主题”页面上说,在功能下,小部件可用,但是当我导航到小部件部分时,我收到错误“未定义侧边栏”。在我的 index.php 中,我添加了“get_sidebar()”行。
这是什么原因造成的,我该如何解决?
【问题讨论】:
标签: wordpress