Support

Account

Home Forums Front-end Issues Nested Repeater Variable Only Returning Only One URL Reply To: Nested Repeater Variable Only Returning Only One URL

  • Yes, an array is definitely what I was looking for. I knew i was close, just couldn’t put my finger on it. Thank you for the insight!

    Now, just to be clear then, the declaration portion of the code would look like:

    
    $tracks = array();
    
    <?php if( have_rows('audio_samples_parent') ): ?>
    	<?php while( have_rows('audio_samples_parent') ): the_row();
    		$tracks[] = get_sub_field('audio_tracks'); ?>
    	<?php endwhile; ?>
    <?php endif; ?>
    

    and then to loop through the values, i would then call:

    
    <?php 
    if( have_rows('audio_samples_parent') ): ?>
    	<ul>
    		<?php 
    
    		while( have_rows('audio_samples_parent') ): the_row();
    
    		?>
    			<li>
    										
                                <audio controls>
      											
                                 <source src="<?php echo $tracks; ?>"  type="audio/mpeg">
    										
                                </audio>
    			</li>
    
    		<?php endwhile; ?>
    
    	</ul>
    <?php endif; ?>
    

    Not sure if this is 100% right or not but any more info you can send my way is highly appreciated. Thanks!