• Resolved acrspf

    (@acrspf)


    Hi, thanks for the great plugin.

    Using the code from the post “Instructions for use on frontend?” I’ve made my image display from my gallery work. What I can’t figure out is how to get the thumbnails to be linked to the full sized images so I can display them in a lightbox. Here is what I have so far. This works to display the image thumbnails, and the images have a link, but it always defaults to the current post url and not the image url.
    I know I’m missing something in the $url declaration but not sure what.
    Thanks for any help you can provide. 🙂

    	$images = get_field('post_gallery');
    foreach($images as $gallery){
    $url = $gallery['metadata']['file_url'];
    ?>
    <div style="display:inline-block;">
    <!-- <img src="<?php echo $gallery['metadata']['thumbnail']['file_url']; ?>" alt="Gallery Image"/> -->
    <a href="<?php echo $url; ?>">'<img src="<?php echo $gallery['metadata']['thumbnail']['file_url']; ?>">'</a>

    </div>
    • This topic was modified 2 months ago by acrspf.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Navneil Naicker

    (@navzme)

    Hello,

    Change $url = $gallery['metadata']['file_url']; to $url = $gallery['metadata']['full']['file_url'];

    Thread Starter acrspf

    (@acrspf)

    Doh! I knew it had to be something simple 🙂

    You are awesome! Thank you sir.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.