Created
February 11, 2016 06:26
-
-
Save generatepress/65aff21092a25e5a6f97 to your computer and use it in GitHub Desktop.
Remove the link to the single post from the post 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
if ( ! function_exists( 'generate_post_image' ) ) : | |
/** | |
* Prints the Post Image to post excerpts | |
*/ | |
add_action( 'generate_after_entry_header', 'generate_post_image' ); | |
function generate_post_image() | |
{ | |
// If there's no featured image, return | |
if ( ! has_post_thumbnail() ) | |
return; | |
// If we're not on any single post/page or the 404 template, we must be showing excerpts | |
if ( ! is_singular() && ! is_404() ) { | |
?> | |
<div class="post-image"> | |
<?php the_post_thumbnail( apply_filters( 'generate_page_header_default_size', 'full' ), array('itemprop' => 'image') ); ?> | |
</div> | |
<?php | |
} | |
} | |
endif; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment