Hello There,
Thanks for updating in! I went ahead and have updated your code. I used this one instead:
/* Add excerpt to product page */
function x_woocommerce_shop_product_thumbnails_custom() {
GLOBAL $product;
$id = get_the_ID();
$thumb = 'entry';
$rating = ( function_exists( 'wc_get_rating_html' ) ) ? wc_get_rating_html( $product->get_average_rating() ) : $product->get_rating_html();
woocommerce_show_product_sale_flash();
echo '<div class="entry-featured">';
echo '<a href="' . get_the_permalink() . '">';
echo get_the_post_thumbnail( $id, $thumb );
if ( ! empty( $rating ) ) {
echo '<div class="star-rating-container aggregate">' . $rating . '</div>';
}
echo '</a>';
echo "</div>";
}
//add_action('init', 'x_override_product_item', 99999999 );
function x_override_product_item () {
remove_action( 'woocommerce_before_shop_loop_item_title', 'x_woocommerce_shop_product_thumbnails', 10 );
add_action( 'woocommerce_before_shop_loop_item_title', 'x_woocommerce_shop_product_thumbnails_custom', 10 );
}
add_action( 'woocommerce_after_shop_loop_item_title', 'add_product_excerpt' );
function add_product_excerpt() {
if ( x_is_shop() ) {
echo '<div class="mtl">';
woocommerce_template_single_excerpt();
echo '</div>';
}
}
/* */
If you want to make the excerpt display in white color, please add the following CSS code in the X > Theme Options > Global CSS (http://prntscr.com/evui3r)
.woocommerce-product-details__short-description {
color: #fff;
}
Please check your site now.