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
I’m not sure that I completely understand what $block['testimonial_image']
is expected to hold at this point. If it is an image field that is returning an array it could hold an empty array, the value false
or an empty string it no image is entered. Instead of checking to see if it !==
exactly equal an empty string try empty
<?php if (!empty($block['testimonial_image'])) : ?>
<div class="testimonial-image"><img src="<?=$block['testimonial_image']['sizes']['image-90-90']?>"/></div>
<?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.