do_shotcode issue using get_template_part
-
Hi!
First of all! Thanks for a fantastic plugin. I have used for a lot of static content and worked brilliant.
This time I’m working on a site that dispplays cd-releases. Some of them will be available do everyone but some will be restricted to specific countries only.
I’m using the do_shortcode function as explained in the wordpress codex:
echo do_shortcode('[iscorrect]'.$text_to_be_wrapped_in_shortcode.'[/iscorrect]');
But instead of just showing text I want to use the same template part that I’m using for all the releases. Like this:
if ( get_field('releaseCountry') == 'Japan' ) { $text_to_be_wrapped_in_shortcode = get_template_part( 'content', 'release' ); echo do_shortcode('[CBC country="jp, ch" show="y"]'.$text_to_be_wrapped_in_shortcode.'[/CBC]'); } else { get_template_part( 'content', 'release' ); }
But when I’m using the get_templet_part in between the shortcode it shows the content anyway.
Am I doing anything wrong?
Cheers
//Emil
- The topic ‘do_shotcode issue using get_template_part’ is closed to new replies.