Last active
August 29, 2015 14:13
-
-
Save gspice/c5c834d426a16975023c to your computer and use it in GitHub Desktop.
WAP inserts the featured image into the content automatically unless otherwise excluded
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
// Add featured image above single posts. | |
add_action( 'genesis_before_entry_content', 'wap_featured_image' ); | |
function wap_featured_image() { | |
// Return early if not a singular or does not have thumbnail | |
if ( ! is_singular() || ! has_post_thumbnail() || is_page(36) || is_page(37) || is_page(38) ) { | |
return; | |
} | |
echo '<div class="featured-image">'; | |
echo get_the_post_thumbnail( $thumbnail->ID, 'feature-wide' ); | |
echo '</div>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment