Note: This is a Developer level doc. If you are unfamiliar with code and resolving potential conflicts, select a WooExpert or Developer for assistance. We are unable to provide support for customizations under our Support Policy.
If you wish to automatically display the post excerpt on your archive / search results page etc (instead of using the <!– more –> tag), use:
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 | |
} |
the_excerpt
/ excerpt_length
, etc. as usual.