Skip to content

Instantly share code, notes, and snippets.

@jameskoster
Created November 11, 2014 09:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jameskoster/efcada4cfc460f790127 to your computer and use it in GitHub Desktop.
Save jameskoster/efcada4cfc460f790127 to your computer and use it in GitHub Desktop.
Storefront - Only display post excerpt on archives
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