admin管理员组文章数量:1130349
I'm trying to implement collapsible Bootstrap 4 cards on sidebar widgets, until now I have this:
register_sidebar(
array(
'name' => esc_html__( 'New Sidebar', 'ns' ),
'id' => 'new_sidebar',
'description' => esc_html__( 'New Sidebar', 'ns' ),
'before_widget' => '<div class="card">',
'after_widget' => '</div></div></div><br>',
'before_title' => '<h5 class="card-header mt-0"><a data-toggle="collapse" href="#collapse-example-%1$s" aria-expanded="true" aria-controls="collapse-example-%1$s" id="heading-example" class="d-block">
<i class="fa fa-chevron-down float-right"></i>',
'after_title' => '</a></h5><div id="collapse-example-%1$s" class="collapse show" aria-labelledby="heading-example"><div class="card-body">',
)
);
The problem is that each collapsible container need an unique id to know which one open or close but my problem is in 'before_title' and 'after_title' because I'm not able to replace with the id. Anyone can help me with this?
I'm trying to implement collapsible Bootstrap 4 cards on sidebar widgets, until now I have this:
register_sidebar(
array(
'name' => esc_html__( 'New Sidebar', 'ns' ),
'id' => 'new_sidebar',
'description' => esc_html__( 'New Sidebar', 'ns' ),
'before_widget' => '<div class="card">',
'after_widget' => '</div></div></div><br>',
'before_title' => '<h5 class="card-header mt-0"><a data-toggle="collapse" href="#collapse-example-%1$s" aria-expanded="true" aria-controls="collapse-example-%1$s" id="heading-example" class="d-block">
<i class="fa fa-chevron-down float-right"></i>',
'after_title' => '</a></h5><div id="collapse-example-%1$s" class="collapse show" aria-labelledby="heading-example"><div class="card-body">',
)
);
The problem is that each collapsible container need an unique id to know which one open or close but my problem is in 'before_title' and 'after_title' because I'm not able to replace with the id. Anyone can help me with this?
本文标签: widgetsSiderbar implementation with collapsible bootstrap cards
版权声明:本文标题:widgets - Siderbar implementation with collapsible bootstrap cards 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749139298a2321897.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论