Created
September 4, 2013 18:52
-
-
Save intelliweb/6441208 to your computer and use it in GitHub Desktop.
WP: Featured image as banner with default image if no featured image is selected
This file contains hidden or 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 featured image is set, use it | |
if ( has_post_thumbnail() ) { | |
the_post_thumbnail('full'); | |
// If no featured image, use specified image (change ID '1' to desired image) | |
} else { | |
echo wp_get_attachment_image(1, 'full'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment