Hello I’m trying to get the value of the image url with the custom size but it is not working.
I tried with the example you gave in the images documentation page but i think I’m doing something wrong as i changed get_field to get_sub_field as i have the image in a Repeater..
There is no problem with cropping the image in the admin with Options add-on page but just can’t get the values to display the cropped image.
Thanks`<!–Featured Image Slider–>
<?php if(get_field('orbit_slider', 'option')): ?>
<?php while(has_sub_field('orbit_slider', 'option')): ?>
<li>
<?php $attachment_id = get_sub_field('orbit_image');
$size = “customsize”;
$image = wp_get_attachment_image_src( $attachment_id, $size );
// url = $image[0];
// width = $image[1];
// height = $image[2];
?>
<img src=”<?php echo $image[0]; ?>” />
</li>
<?php endwhile; ?>
<?php endif; ?>
<!– End Featured Image Slider–> `
okay it took me sometime but figured it out till the end
I had to add the ‘option’ when calling for the image field
<?php $attachment_id = get_sub_field(‘orbit_image’, ‘option’);
🙂