Home › Forums › Add-ons › Repeater Field › FOR EACH Inside of an IF/ELSE using Select Field/Repeater › Reply To: FOR EACH Inside of an IF/ELSE using Select Field/Repeater
<section id="testimonial-slideshow"<?php
if ($section['background_image_or_color'] == 'Image') {
?> class="background-cover" style="background-repeat: no-repeat; background-image: url('<?php
echo $section['image']['sizes']['image-1280-460']; ?>');" data-stellar-background-ratio="0.75"<?php
} else {
?> class="<?php echo $section['background_color']; ?>"<?php
}
?>>
<h2 class="text-center"><?php echo $section['title']; ?></h2>
<?php
foreach ($section['testimonials'] as $item => $block) {
?>
<div .... the rest of your code in here
<?php
} // end foreach testimonial
?>
</section>
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.