只需注册侧栏并确定在小部件之前和之后添加什么:
register_sidebar( array(
\'name\' => __(\'My sidebar\', \'cht\'),
\'id\' => \'mysidebar\',
\'class\' => \'sidebar_area\',
\'before_widget\' => \'<div id="%1$s" class="sidebar_content %2$s">\',
\'after_widget\' => "</div>\\n",
\'before_title\' => \'<h4>\',
\'after_title\' => "</h4>\\n"
));