Created
November 11, 2014 09:53
-
-
Save jameskoster/efcada4cfc460f790127 to your computer and use it in GitHub Desktop.
Storefront - Only display post excerpt on archives
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_action( 'init', 'jk_customise_storefront' ); | |
function jk_customise_storefront() { | |
// Remove the storefromt post content function | |
remove_action( 'storefront_loop_post', 'storefront_post_content', 30 ); | |
// Add our own custom function | |
add_action( 'storefront_loop_post', 'jk_custom_storefront_post_content', 30 ); | |
} | |
function jk_custom_storefront_post_content() { | |
?> | |
<div class="entry-content" itemprop="articleBody"> | |
<?php | |
if ( has_post_thumbnail() ) { | |
the_post_thumbnail( 'full', array( 'itemprop' => 'image' ) ); | |
} | |
?> | |
<?php the_excerpt(); ?> | |
</div><!-- .entry-content --> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment