How to wrap the widget content with a div or get the widget title outside?

this is the solution to wrap the content after the title like this

'before_widget' => '<li>',
'after_widget'  => '</div></li>',
'before_title'  => '<h2 class="widgettitle">',
'after_title'   => '</h2><div class="widgetcontent">' ); ?>

the important markup is the <div class="widgetcontent>" in the after_title, and the closing </div> in the after_widget, this will result in this html markup:

<ul>
   <li>
     <h2 class="widgettitle">Title</h2>
     <div class="widgetcontent">
        <!-- widget stuff-->
     </div>
   </li>
</ul>

Leave a Comment