Support

Account

Home Forums General Issues Fancybox with simple image

Solved

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

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

    I’ve used :

    <?php 
    $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=""  />
    	 </a>
    
    <?php endif; ?>
Viewing 2 posts - 1 through 2 (of 2 total)

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