Last active
October 1, 2015 08:06
-
-
Save dbridgman/9ac2c040637c6df9f1a3 to your computer and use it in GitHub Desktop.
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
<div class="post-thumbnail"> | |
//Adjusted the code so it integrates Wordpresses default thumbnail size - This can be changed in Settings -> Media | |
<?php if ( has_post_thumbnail() ) { the_post_thumbnail('thumbnail'); } else | |
{ ?> | |
<img src="<?php bloginfo('template_directory'); ?>/MYIMAGESFILE/MYFEATUREIMAGE.jpg" alt="Post Thumbnail" /> | |
<?php } ?> | |
</div> | |
This code pulls a posts thumbnail, then sets a default if the post is lacking one. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment