Add the product description below the product, see: Short Description Below Product (WordPress Forums)
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
<?php | |
/** | |
* Add the product description (the excerpt of the cpt) below the product. | |
* | |
* @author Joshua David Nelson, [email protected] | |
* @link https://wordpress.org/support/topic/short-description-below-product | |
*/ | |
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 />'; | |
} | |
} |
Source: https://gist.github.com/joshuadavidnelson/364e77d0301e253e571c
Tags: woocommerce