When your website means business.

ACF | Type: PHPACF Images: Image Array

Select’Image Array’ option to access an array of image attributes. Useful for thumbnail support.

<?php 
$image = get_field('image');
if ($image) {
    echo '<img src="'.$image['url'].'" alt="'.$image['alt'].'" />';
}
?>

<?php 
// vars
$image = get_field('page_image'); //select 'image array' option in ACF
$url = $image['url'];
$title = $image['title'];
$alt = $image['alt'];
//$caption = $image['caption'];
// thumbnail
$size = 'thumbnail';
$thumb = $image['sizes'][ $size ];
//$width = $image['sizes'][ $size . '-width' ];
//$height = $image['sizes'][ $size . '-height' ];
if ($image) {
echo '<a href=".$url.'" title="'.$title.'">';
echo '<img src="'.$thumb.'" alt="'.$alt.'" />';
echo '</a>';
}
?>

Reference Links

Menu
We use cookies in order to give you the best possible experience on our website. By continuing to use this site, you agree to our use of cookies.
Accept
Cookies Notice