This is how i registered my sidebar:
register_sidebar(array(
\'name\' => \'Post Sidebar\',
\'before_widget\' => \'<div class="widgetdiv"><div id="%1$s" class="widget %2$s">\',
\'after_widget\' => \'</div></div>\',
\'before_title\' => \'<div class="titlediv">\',
\'after_title\' => \'</div>\',
));
The problem I have:
标题div包装在widgetdiv中。上面的代码输出如下。
<div class="widgetdiv">
<div class="titlediv">My title
</div>
</div>
My requirement: <div class="titlediv">My title
</div>
<div class="widgetdiv">
</div>
我是说titlediv应该在widgetdiv外面
谁能给我一个好的解决方案?。谢谢
最合适的回答,由SO网友:Rob Vermeer 整理而成
register_sidebar(array(
\'name\' => \'Post Sidebar\',
\'before_widget\' => \'<div id="%1$s" class="widget %2$s">\',
\'after_widget\' => \'</div></div>\',
\'before_title\' => \'<div class="titlediv">\',
\'after_title\' => \'</div><div class="widgetdiv">\',
));
您将有一个包装器div,然后是标题div,然后是widgetdiv。