ACF Images & Lightbox Plus

You can retrieve the WordPress default image sizes (as well as set custom image sizes) using Advanced Custom Fields using the following:

<?php $image = get_field('image'); 

echo $image['url']; //This is the full image

echo $image['sizes']['large']; This is the large image

echo $image['sizes']['medium']; // This is the medium image

echo $image['sizes']['thumbnail']; //This is the thumbnail image

?>

Tie this information together with Lightbox Plus like so:

<a href='<?php echo $image['url']; ?>' rel="lightbox">
     <img src="<?php echo $image['sizes']['large']; ?>" alt="<?php echo $image['caption']; ?>" />
</a>

Advanced Custom Field size information.

Lightbox Plus usage with ACF.

Leave a Reply

katherine as a flat graphic icon

About Me

I’m an African / Ojibwe First Nations Web Developer living in Winnipeg, Manitoba.

Visit the Tips and Blog to see what I’m working on.