Skip to content

Instantly share code, notes, and snippets.

Last active January 12, 2018 05:30
What would you like to do?
Add the product description below the product, see: This is the updated code, using `get_the_excerpt()`
* Add the product description (the excerpt of the cpt) below the product.
* @author Joshua David Nelson,
* @link
add_action( 'woocommerce_after_shop_loop_item_title', 'jdn_add_short_description', 9 );
function jdn_add_short_description() {
// Description linked to product
$url = get_the_permalink();
if( $url ) {
echo '<span class="title-description"><a href="' . $url . '">' . get_the_excerpt() . '</a></span><br />';
} else {
echo '<span class="title-description">' . get_the_excerpt() . '</span><br />';
Copy link


I added this into my function.php file of our child theme to have the description under the price in the listings page. It worked great, however then by boss decided she didn't really want this function and I deleted the code and saved the file. Since then I am seeing half of the description, I can't hide it with css or figure out how to get rid of it. Any help would be great, thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment