Home Forums Add-ons Gallery Field Lightbox / Gallery Issue


Lightbox / Gallery Issue

    • mtm

    • February 6, 2020 at 10:24 am

    i posted this question under this discussion and then realised it was marked as solved so may not be seen.

    i use a combination of ACF’s gallery field and the simple lightbox wordpress plugin in most sites, and never see a problem, but in this case i cannot get it to work. images simply open as you would expect with no lightbox. the appropriate html is being added to the page but the functionality just fails to fire. no errors rthat i can see in the console.

    here’s the code:

    <?php $images = get_field('project_images');
    if( $images ): ?>
     <div class="car-main-col" id="masonry-wrap" data-columns>    
      <?php foreach( $images as $image ): 
       $content = '<div>';
       $content .= '<a class="gallery_image" href="'. $image['url'] .'">';
       $content .= '<img src="'. $image['sizes']['medium'] .'" alt="'. $image['alt'] .'" />';
       $content .= '</a>';
       $content .= '</div>';
      if ( function_exists('slb_activate') ){
      $content = slb_activate($content);
      echo $content;?>
      <?php endforeach; ?>
    <?php endif; ?>

    and the page can be seen here:

    i know this is the/a correct solution as i’m finding the same answer everywhere (e.g. here) and have used this code countless times in the past.

    i’ve tried running it outside the masonry plugin (salvattore.js) and in separate default page templates without the extra functionality. no dice.

    any help troubleshooting this would be most welcome.


Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.