This is my sidebar code
register_sidebar(array(
'name' => 'Post Sidebar',
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div></div>',
'before_title' => '<div class="titlediv">',
'after_title' => '</div><div class="widgetdiv">',
));
The above code displays widget title and widget content in separate divs. I want them in separate div because i want to implement collapse feature in widget.
Now here is my problem. I don't want that id
before widget. I need it after title.
I modified the code like this
register_sidebar(array(
'name' => 'Post Sidebar',
'before_widget' => '<div class="widget %2$s">',
'after_widget' => '</div></div>',
'before_title' => '<div class="titlediv">',
'after_title' => '</div><div id="%1$s" class="widgetdiv">',
));
But its not working. Can anyone help me? Thanks
$(.widget#id .widgetdiv)
I used jQuery as an example, you can easily adapt it to your script.