pierrebalian
3/16/2017 - 3:58 PM

Acf using object type and outputing with set thumbnail size From https://support.advancedcustomfields.com/forums/topic/images-url-id/

Acf using object type and outputing with set thumbnail size From https://support.advancedcustomfields.com/forums/topic/images-url-id/

<?php	$attachment_id = get_field('image');
$size = "img-thumb"; // (thumbnail, medium, large, full or custom size)
$size2 = "large";
$image = wp_get_attachment_image_src( $attachment_id, $size );
$image2 = wp_get_attachment_image_src( $attachment_id, $size2 );
// url = $image[0];
// width = $image[1];
// height = $image[2];
?>
<a href=<?php echo $image2[0]; ?> class="ai-thumb" rel="lightbox">
<span class="ititle"><?php the_field('titre'); ?></span>
<img  src=<?php echo $image[0]; ?> />
</a>