Skip to content

Instantly share code, notes, and snippets.

@galengidman
Created March 28, 2014 19:10
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save galengidman/9840672 to your computer and use it in GitHub Desktop.
get ACF image size URL by image object
<?php
// first, get the image object returned by ACF
$image_object = get_field('my_image_field');
// and the image size you want to return
$image_size = 'thumbnail';
// now, we'll exctract the image URL from $image_object
$image_url = $image_object['sizes'][$image_size];
?>
<img src="<?php echo $image_url; ?>" alt="">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment