If you ever make an image custom field with ACF, you may want to get that image and output it in your theme. This can be done easily, but getting the image without passing it through WordPress functions, means you won’t get any filters and hooks affecting it, which you probably want.
Ignition comes with two functions for easily getting an image.
ign_get_image( $acf_image = '', $id = '', $size = '', $attr = '', $use_thumbnail_as_fallback = false ); ign_get_image_url( $acf_image = '', $id = '', $size = '', $use_thumbnail_as_fallback = false );
Both these functions can be found in inc/extras.php and are almost the same. T
The regular version will return an image tag. This version can also be passed image attributes, just like you would with
The second version returns a url. No attributes can be passed here.
Both do have the ability to fallback on the featured image, if no image is found. By default it’s set to false.
Make sure you get the image field first like this:
$my_image = get_field('image_field'); //or get_sub_field if your in a repeater echo ign_get_image($my_image); //will show the image html echo ign_get_image_url($my_image'); //will show the url to the image