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; ?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.