Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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