I created a shortcode for Bootstrap Collapsible, I placed a shortcode inside it like fotorama plugin and fotorama didn’t work. I Googled the problem and I found the fix on WP website. In order for a shortcode to output another shortcode, you need to use ‘do_shortcode($content)’ instead of just ‘$content’ as a content inside the open and close shortcode [][/].
add_shortcode( ‘mybs’, ‘mybs_func’ );
function mybs_func($atts, $content = null) {
extract(shortcode_atts(array(
‘data’ => ”,
‘title’ =>”,
), $atts));
return
‘<button type=”button” class=”btn btn-info” data-toggle=”collapse” data-target=”‘.’#’.$atts[‘data’].'”>’.$atts[‘title’].'</button>’.
‘<div id=”‘.$atts[‘data’].'” class=”collapse”>’.do_shortcode($content).'</div>’
; }
Examples:
shortcode “myfotorama” top of page.
This is a red button
[title]This is shortcode for collapsible bootstrap [/title][body]
This is fotorama gallery inside the collapsible bootstrap body
shortcode “gallery ids=”6476,6475,6473,6474,6471″ allowfullscreen=yes”
[/body]