Home › Forums › ACF PRO › Warning: Invalid argument "**" foreach "**" api-helpers.php on line 3213 › Reply To: Warning: Invalid argument "**" foreach "**" api-helpers.php on line 3213
Hello John,
yes you are right – I forgot to put in another line of code:
<?php $images = get_field('bildergalerie'); if( $images ): ?>
<div class="ar-karussell-wrapper">
<div class="ar-karussell">
<?php foreach( $images as $image ): ?>
<div class="carousel-cell">
<figure class="article-feat-figure">
<img data-flickity-lazyload-src="<?php echo $image['url']; ?>" alt="<?php echo $image['caption']; ?>">
</figure>
<?php
if($image['caption']!="" ){
?>
<div class="img-caption-featured"><?php echo $image['caption']; ?></div>
<?php }
else{ ?>
<?php } ?>
</div>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
The Gallery is on a post.
Thanks for your reply!
Best Mikkel
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.