WordPress widget title out of container

How can I move widget title out of container ?

Desired output:

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

My function:

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

My output:

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

Related posts

Leave a Reply

1 comment

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

    You just need to move the order around very slightly.