• Hi I am using the plugin with ACF. The lightbox is set to Fancybox (the problem is common to other display options) and displays a gallery image when the thumbnail is clicked. However to advance through the gallery you have to click to the right (or left) twice on the lightbox image – is this a bug?
    This is my code:

    <?php
    if(get_field('profile_gallery')){
    $images = get_field('profile_gallery');
    foreach( $images as $image ) {
    ?>
    <a href="<?php echo $image['url']; ?>" rel="lightbox[profile_gallery]">
    <img src = "<?php echo $image['url']; ?>" width="100%"/><?php
    }
    }
    ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author dFactory

    (@dfactory)

    Your code is fine, however it requires small fix:

    change:
    rel=”lightbox[profile_gallery]”

    to:
    data-rel=”lightbox-gallery-1″ (or any other unique number)

    Thread Starter Candlelite

    (@candlelite)

    Many thanks for the quick reply. I have made the change exactly as you have shown:
    <a href="<?php echo $image['url']; ?>" data-rel="lightbox-gallery-1">
    But I am still having the same issue of two clicks to move through the gallery. When I hover over the image the nav arrows show – when I click arrow the image blinks (I think it is reloading) – when I click for the second time the next image in the gallery appears.

    Thread Starter Candlelite

    (@candlelite)

    Hi I found the problem my code was missing the closing “a” tag (/a) once I added the tag everything works fine using your code solution or my original code (rel="lightbox[profile_gallery]). Thanks for your help and the great plugin. Best regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Two clicks to change gallery image’ is closed to new replies.