容器中的Wordpress小部件标题

时间:2014-12-11 09:50:19

标签: html wordpress widget

如何将小部件标题移出容器?

期望的输出:

<h2 class="at-widget-title"><span>Recent Posts</span></h2>  
   <div class="at-widget-container widget_recent_entries" id="recent-posts-2">      
</div>

我的功能:

function arphabet_widgets_init() {

    register_sidebar( array(
        'name' => 'SideBar',
        'id' => 'side_bar_1',
        'before_widget' => '<div class="at-widget-container %2$s" id="%1$s">',
        'after_widget' => '</div>',
        'before_title' => '<h2 class="at-widget-title"><span>',
        'after_title' => '</span></h2>',
    ) );
}

我的输出:

<div class="at-widget-container widget_recent_entries" id="recent-posts-2">     
    <h2 class="at-widget-title"><span>Recent Posts</span></h2>      
</div>

1 个答案:

答案 0 :(得分:1)

function arphabet_widgets_init() {

    register_sidebar( array(
        'name' => 'SideBar',
        'id' => 'side_bar_1',
        'before_widget' => '',
        'after_widget' => '</div>',
        'before_title' => '<h2 class="at-widget-title"><span>',
        'after_title' => '</span></h2><div class="at-widget-container %2$s" id="%1$s">',
    ) );
}

你只需稍微调整一下订单。