do_shortcode seems not to work
-
I need to add the shortcode in a template and the url value is taken from a custom field managed by ACF. I used this code.
<?php $url = the_sub_field('podcast_url'); echo do_shortcode('[powerpress url="'. $url . '"]'); ?>
The url prints out correctly so as long of what concerning acf plugin there are no errors.
The problem is around the concatenated variable.
If a take the dots out:
echo do_shortcode('[powerpress url="$url"]');
The player would print out correctly, of course instead of the url there would be the variable.
What did I mistake?
Thank you for any help!
Viewing 14 replies - 1 through 14 (of 14 total)
Viewing 14 replies - 1 through 14 (of 14 total)
- The topic ‘do_shortcode seems not to work’ is closed to new replies.