Home › Forums › Add-ons › Repeater Field › All images from repeater › Reply To: All images from repeater
Hi @alekspvn
I’m not sure I am 100% clear on what is being asked, but I am going to do my best to help. I may need more clarification.
The Image field can return an Array, a URL, or an ID for each image, so it largely depends on which choice you made as the Return Value how you write the code.
Since Array is the default return value, I will show code for that below:
I am guessing you need help with the code between the ‘div’ with the ‘panel’ and ‘multiple-items’ classes, so here goes…
<?php
if ( have_rows('photo_slider') ) {
while ( have_rows('photo_slider') ) {
the_row();
$slide_photo = get_sub_field('add_photo');
if ( !empty($slide_photo) ) {
?>
<img src="<?php echo $slide_photo['url']; ?>" alt="<?php echo $slide_photo['alt']; ?>" />
<?php
}
}
}
?>
Is that what you are looking to achieve? I will get an email alert with your reply, and will help further if need be!
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.