检查您的sidebar.php
和functions.php
对于主题,侧栏定义小部件外部的标记;功能register_sidebar()
定义小部件内容之前的标记;必须更改此标记。有关此功能,请参阅codex:codex register_sidebar()
编辑具体来说,您需要查看before_widget
和after_widget
的参数register_sidebar()
参数数组。
如果register_sidebar()
通话内容如下:
register_sidebar(array( // Right Column widget area
\'name\'=>\'Sidebar Right\',
\'id\'=>\'sidebar-right\',
\'description\' => \'Right-column, half-width sidebar in three-column layout\',
\'before_widget\' => \'<div id="%1$s" class="widget %2$s">\',
\'after_widget\' => \'</div>\',
\'before_title\' => \'<div class="title">\',
\'after_title\' => \'</div>\',
));
然后将其更改为:
register_sidebar(array( // Right Column widget area
\'name\'=>\'Sidebar Right\',
\'id\'=>\'sidebar-right\',
\'description\' => \'Right-column, half-width sidebar in three-column layout\',
\'before_widget\' => \'<li id="%1$s" class="widget %2$s">\',
\'after_widget\' => \'</li>\',
\'before_title\' => \'<div class="title">\',
\'after_title\' => \'</div>\',
));
具体而言,您正在更改以下内容:
\'before_widget\' => \'<div id="%1$s" class="widget %2$s">\',
\'after_widget\' => \'</div>\',
对此:
\'before_widget\' => \'<li id="%1$s" class="widget %2$s">\',
\'after_widget\' => \'</li>\',