I wanted so that my widget has the following structure:
<div class="widget-area">
<h4 class="widget-title">Foo Bar</h4>
<div class="widget-content">Blablablabla blabla</div>
</div>
so I registered my sidebar...
register_sidebar(array(
'name' => 'Sidebar Widget Area',
'id' => 'sidebar-widget-area',
'description' => 'Choose Widget(s) to display in this area.',
'before_widget' => '<div class="widget-area">',
'after_widget' => '</div></div>',
'before_title' => '<h4 class="widget-title">',
'after_title' => '</h4><div class="widget-content">'
));
It looked good at first... but things went awry whenever there's a widget without title. The reason is kinda obvious, without the title, there will be an extra </div>
in the markup.
Question:
Is there any good method to achieve my desired markup? ( with/without a widget title )
==========================================
NB: I'm sorry if the thread's title is kinda different from the main question.