I would like to use toggle option in my sidebar widgets. But my sidebar widgets not generating unique id. This is my register sidebar code.
register_sidebar(array(
'name' => 'Main Sidebar',
'before_widget' => '<div class="widget %2$s">',
'after_widget' => '</div></div></div>',
'before_title' => '<div class="titlediv">',
'after_title' => '<a class="dropdown" style="float: right;" href="#%1$s" data-toggle="collapse"><b class="toggleicon"></b></a></div><div id="%1$s" class="collapse in"><div id="%1$s" class="boxdiv">'
)
This is how i'm getting output
<div class="widget widget_stc-followers">
<div class="titlediv">Widget Title<a class="dropdown" style="float: right;" href="#%1$s" data-toggle="collapse"><b class="toggleicon"></b></a></div><div id="%1$s" class="collapse in"><div id="%1$s" class="boxdiv">
Widget content
</div></div></div>
I mean %1$s
not working in after_title
. I want to use unique id. So can anyone give me some tips to make it work?
Thanks