Support

Account

Forum Replies Created

  • 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!

  • Hi guys, got this figured out. Turns out rather than trying to define a “$tracks” variable, which can obviously only store one item, i left out the sub-repeater loop in the declaration area and simply used

    <div class="talenthalf"><strong><u>Audio Samples</u><br />
    							<?php 
    							if( have_rows('audio_samples_parent') ): ?>
    								<ul>
    								<?php 
    
    								while( have_rows('audio_samples_parent') ): the_row();
    
    									?>
    									<li>
    										<audio controls>
      											<source src="<?php the_sub_field('audio_tracks'); ?>"  type="audio/mpeg">
    										</audio>
    									</li>
    
    								<?php endwhile; ?>
    
    								</ul>
    							<?php endif;
    							?>
    					</strong></div>

    to loop through the files uploads. Hope this helps someone else!

  • Bump. Any help is appreciated guys; just figuring out how to store/echo multiple files within the $tracks variable. Thank you for your help!

Viewing 3 posts - 1 through 3 (of 3 total)