I tried to use
[su_posts template="templates/my-list.php"]
with my code:
<?php echo do_shortcode("[su_tabs vertical=\"yes\"]"); ?>
<?php
// Posts are found
if ( $posts->have_posts() ) {
while ( $posts->have_posts() ) {
$posts->the_post();
global $post;
?>
<?php echo do_shortcode("[su_tab title=\". the_ID() .\" disabled=\"no\" anchor=\"\" url=\"\" target=\"blank\" class=\"\"]"); ?>
<?php echo do_shortcode("[/su_tab]"); ?>
<?php
}
}
?>
<?php echo do_shortcode("[/su_tabs]"); ?>
but the only output to web is [/su_tab] [/su_tabs]
Plugin Author
Vova
(@gn_themes)
Hi @felixik,
the working example:
<?php
$my_tabs = '';
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
$my_tabs .= sprintf(
'[su_tab title="%s"]%s[/su_tab]',
esc_attr( get_the_title() ),
get_the_content()
);
endwhile;
endif;
echo do_shortcode( '[su_tabs]' . $my_tabs . '[/su_tabs]' );
?>