Viewing 1 post (of 1 total)
  • Author
  • #46829
    Sheree Walker

    Hi there.

    I have gone through your documentation regarding using ACF with the lightbox function but I just can’t get it to work.

    The closest I have come is this:

     <?php if ( have_rows( 'yacht_preview_gallery' ) ) : ?>
                                 <?php while ( have_rows( 'yacht_preview_gallery' ) ) : the_row(); ?>
                                   <?php $gallery_image_teaser = get_sub_field( 'gallery_image_teaser' ); ?>
                                   <?php if ( $gallery_image_teaser ) : ?>
                                   <div id="preview-image-container">
                                     <div class="the-image">
                                   <a data-rel="lightbox-gallery-1"  href="<?php echo esc_url( $gallery_image_teaser['url'] ); ?>">
                                    <img src="<?php echo esc_url( $gallery_image_teaser['url'] ); ?>" class="test" alt="<?php echo esc_attr( $gallery_image_teaser['alt'] ); ?>"  />
                                   <?php endif; ?>
                                 <?php endwhile; ?>
                               <?php else : ?>
                                 Please add some images.
                               <?php endif; ?>

    But the images are not grouped andjust open by themselves with no ability to scroll through to the next slide and no navigation features (close etc).

    I have been at it for most of the day and I’m going a little crazy.

    Lastly – At the moment I am using a custom page template to output a yacht listing. This gallery is bang in the middle of the content so I need to work out a way to add a shortcode to the page template so the gallery field shows BUT in such a way that the client can still select the gallery (it’s a hidden gallery). Unfortunately I cant used a shortcode specifying a gallery as it needs to be editable.

    Is this possible?

    All I really wanted to do was create Advanced custom fields galleries and have a button to view them and it’s turned into a nightmare :(

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.