Support

Account

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