I am using the repeater field of the Advanced Custom Fields plugin for WordPress to display song names and where relevant, offer a sample to play using the Compact Audio plugin.
I am using the echo shortcode function and this works to an extent - however, it's not actually executing the shortcode and is instead showing the file URL (which is the value of the field "ceremonial_sample"). I have used this on other sites (albeit not within the repeater field - that's the only difference along with the field names). Can anyone tell me how to fix this?
Here is the page where I'm experiencing the problem: [url removed, login to view]
// check if the repeater field has rows of data
if( have_rows('ceremonial') ):
// loop through the rows of data
while ( have_rows('ceremonial') ) : the_row();
// display a sub field value
echo '<div class="song">';
echo '<div class="sample">';
do_shortcode( '[sc_embed_player fileurl="'.the_sub_field( 'ceremonial_sample' ).'"]' );
// no rows found
Professional web developer and designer for more than 7 years. I have advanced experience in WordPress and I can start today if you're interested. Thank you very much