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)

The topic ‘Fancybox with simple image’ is closed to new replies.