Home › Forums › Add-ons › Repeater Field › A repeater in random order including select fields › Reply To: A repeater in random order including select fields
Sorry Nuro, this is probably me being awful at explaining things.
Say at the moment the code is pumping out:
Three separate entries. Logo colour defined and fixed to the caption.
I want it to pump out something like:
OR
OR any random order really. Notice the caption and the logo colour remain the same so it’s just jumbling up the order of the entries not the contents within each entry.
So in essence something like:
<?php if(get_field('slider_image')): ?>
<RANDOM ORDER>
<?php while(has_sub_field('slider_image')): ?>
<?php the_sub_field('the_caption'); ?>
<img src="<?php bloginfo('template_directory'); ?>/logo_<?php if(get_sub_field('logo_colour') == "White") { echo 'white'; } else { echo 'grey'; }?>.png" />
<?php endwhile; ?>
<?php endif; ?>
Flippin’ eck I’m terrible at this stuff.
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.