Woocommerce shop page product description

I added the following code to my functions.php file to add a short product description under the thumbnails on my shop page.

add_action( 'woocommerce_after_shop_loop_item_title', 'lk_woocommerce_product_excerpt', 35, 2);
if (!function_exists('lk_woocommerce_product_excerpt'))
{
function lk_woocommerce_product_excerpt()
{
$content_length = 5;
global $post;
$content = $post->post_excerpt;
$wordarray = explode(' ', $content, $content_length + 1);
if(count($wordarray) > $content_length) :
array_pop($wordarray);
array_push($wordarray, '...');
$content = implode(' ', $wordarray);
$content = force_balance_tags($content);
endif;
echo "<span class='excerpt'><p>$content</p></span>";
}
}

I do not want that text linked to my title, and would like to be able to align the text left, and change the color. Right now it takes on the same css as the product title. Any help would be appreciated!

Related posts

Leave a Reply

1 comment