I'm using a shortcode for accordion. I would like to put a loop inside this shortcode. However the closing tag seems to be unparsed.
<?php echo do_shortcode('[su_accordion]');?>
<?php
if ( have_posts() ) :
while ( have_posts() ) : the_post();
echo '<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">';
echo do_shortcode('[su_spoiler title="'.get_the_title().'" open="no" style="default" icon="plus" anchor="" class=""]'.get_the_content().'[/su_spoiler]');
echo '</div>';
endwhile;
else :
echo wpautop( 'Sorry, no posts were found' );
endif;
?>
<?php echo do_shortcode('[/su_accordion]');?>
The last part of the shortcode is displayed as simple text.
Any solution?