Wordpress可以这样做:
function _tk_widgets_init() {
register_sidebar( array(
'name' => __( 'Sidebar', '_tk' ),
'id' => 'sidebar-1',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
}
add_action( 'widgets_init', '_tk_widgets_init' );
这会产生这样的结果:
<aside>
<h3></h3>
BODY
</aside>
我需要做的是最终:
<aside>
<h3></h3>
<div class="anotherBlock">BODY</div>
</aside>
这可能吗?
答案 0 :(得分:0)
解决它已经存在的问题:
register_sidebar( array(
'name' => __( 'Sidebar', '_tk' ),
'id' => 'sidebar-1',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3><div class="mainWidgetBody">',
'after_widget' => '</div></aside>',
) );