Support

Account

Home Forums Add-ons Options Page Displaying random values in options + repeater Reply To: Displaying random values in options + repeater

  • I know this is 4-5yrs old …
    I’m having similar issues. I have the typical repeater (title, image, link) that I would like to randomize. All of my images are showing up all at once. Could someone please help me roll this row randomization into my existing code below?

    <?php if( have_rows('billboard') ): ?>
    
    	<?php while( have_rows('billboard') ): the_row(); 
    
    		// vars
    		$image = get_sub_field('image');
    		$link = get_sub_field('link');
    
    		?>
    
    			<?php if( $link ): ?>
    				<a href="<?php echo $link; ?>">
    			<?php endif; ?>
    
    				<img class="billboard" src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt'] ?>" />
    
    			<?php if( $link ): ?>
    				</a>
    			<?php endif; ?>
    
    	<?php endwhile; ?>
    
    <?php endif; ?>