I have a Wordpress site using Advanced Custom Fields and need to insert the shortcode value they enter in a PHP template file. I need to insert this code
<?php the_field('image_gallery'); ?>
into this PHP echo
<?php echo do_shortcode('CODE IN HERE'); ?>
So that it can output the shortcode the user enters in the PHP template.
Thank you!
The only way to do this would be to use get_field()
to return
the value stored in image_gallery
to the do_shortcode()
function:
<?php
$image_gallery_shortcode = get_field('image_gallery');
echo do_shortcode( $image_gallery_shortcode );
?>