Skip to content

Instantly share code, notes, and snippets.

@ckschmieder
Created August 27, 2016 15:26
Show Gist options
  • Save ckschmieder/6277be7cdbd0c54892c0b29bba788005 to your computer and use it in GitHub Desktop.
Save ckschmieder/6277be7cdbd0c54892c0b29bba788005 to your computer and use it in GitHub Desktop.
Calling in custom image field that is setup to require user to crop image to set aspect ratio. Replaced Featured Image.
<?php
$image = get_field('top_image');
$link = get_field('link', $image['ID']);
?>
<figure class="featured-image">
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
</figure>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment