Last active
December 15, 2015 18:39
-
-
Save aaronranard/5305599 to your computer and use it in GitHub Desktop.
WordPress: Get the Featured Image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if (has_post_thumbnail( $project->ID )) : ?> | |
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $project->ID ), 'single-post-thumbnail' ); ?> | |
<img src="<?php echo $image[0]; ?>" alt="" /> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment