Home Forums General Issues Fancybox with simple image


Fancybox with simple image

  • Hi Im’ using fancybox and a simple acf image (NOT GALLERY)
    My code below is not working i’m looking everywhere but there are mostly gallery fancybox helps.

    So if you have an idea that would be awesome

        <a rel="fancybox" href="<?php echo $image['url']; ?>">
        <img src="<?php $image = get_field('photo_2'); echo($image['sizes']['medium']); ?>" alt=""  />   </a>
  • Hi Finaly create the solution with a mix of various answers !

    I’ve used :

    $image = get_field('photo_2');
    $image_url = $image['sizes']['medium'];
    if( !empty($image) ): ?>
        <a class="fancybox" href="<?php echo $image['url']; ?>">
    	   <img src="<?php echo $image_url; ?>" alt=""  />
    <?php endif; ?>
Viewing 2 posts - 1 through 2 (of 2 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.