容器外的 WordPress 小部件标题



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

期望输出:

<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>
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">',
    ) );
}

您只需要稍微移动顺序即可。

最新更新