Created
January 26, 2015 21:13
-
-
Save alisonmf/20381adafabab1f68c4c to your computer and use it in GitHub Desktop.
the_post_thumbnail or Featured Image in WordPress
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() ) { | |
the_post_thumbnail(); | |
} else { | |
echo '<img src="'; | |
echo get_stylesheet_directory_uri(); | |
echo '/img/page-banner.jpg" />'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment