Trying to use 'echo do_shortcode' along side Advanced Custom Fields
-
I am trying to setup the [download] shortcode within my template using the Advanced Custom Fields repeater field.
If I have a regular shortcode
<?php echo do_shortcode( "[download label='Download mp3']https://example.com/wordpress/wp-content/uploads/example.mp3[/download]"); ?>
Everything works fine.
But if I try to sub in the advanced custom fields, it prints out the url instead of allowing a download.
<?php echo do_shortcode( "[download]" . the_sub_field('download_link') . "[/download]"); ?>
Is there something I am doing wrong?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Trying to use 'echo do_shortcode' along side Advanced Custom Fields’ is closed to new replies.