Home › Forums › Add-ons › Repeater Field › A repeater in random order including select fields › Reply To: A repeater in random order including select fields
Okay, so I’ve sussed it, it took a while. The two main problems I encountered were:
bloginfo
as opposed to get_bloginfo
which returns a variable.Here’s the final code which works a treat.
<?php
$template_directory = get_bloginfo('template_directory');
$rows = get_field('slider_image');
shuffle ($rows);
if($rows)
{
foreach($rows as $row)
{
echo $row['the_caption'] . '<img src="' . $template_directory . '/logo_' . $row['logo_colour'] . '.png" />'. PHP_EOL;
}
}
?>
Thank you so much Nuro for all your help, I wouldn’t of got there without your assistance.
I’m off to the pub now!
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.