Skip to content

Instantly share code, notes, and snippets.

@erezLieberman
Last active August 29, 2015 14:00
Show Gist options
  • Select an option

  • Save erezLieberman/11378802 to your computer and use it in GitHub Desktop.

Select an option

Save erezLieberman/11378802 to your computer and use it in GitHub Desktop.
image from acf to theme
<?php
$image = get_sub_field('clientLogoImage');
if( !empty($image) ):
// vars
$url = $image['url'];
$title = $image['title'];
$alt = $image['alt'];
$caption = $image['caption'];
// thumbnail
$size = 'testimonial-thumb';
$thumb = $image['sizes'][ $size ];
$width = $image['sizes'][ $size . '-width' ];
$height = $image['sizes'][ $size . '-height' ];
?>
<img src="<?php echo $thumb; ?>" alt="<?php echo $alt; ?>" width="<?php echo $width; ?>" height="<?php echo $height; ?>" />
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment