Support

Account

Home Forums Add-ons Gallery Field ACF gallery + simple lightbox problem Reply To: ACF gallery + simple lightbox problem

  • this should work:

    <?php $images = get_field('gallery');
    if( $images ): ?>
    <div class="gallery">
        <ul>
            <?php foreach( $images as $image ): 
                $content = '<li>';
                    $content .= '<a class="gallery_image" href="'. $image['url'] .'">';
                         $content .= '<img src="'. $image['sizes']['thumbnail'] .'" alt="'. $image['alt'] .'" />';
                    $content .= '</a>';
                $content .= '</li>';
                if ( function_exists('slb_activate') ){
        $content = slb_activate($content);
        }
        
    echo $content;?>
            <?php endforeach; ?>
        </ul>
    </div>
    <?php endif; ?>