I have this code which will put my category description on the thumbnail tile but i would like to change the code to only show about 80 letters of the total description text, as otherwise my homepage and subcategory listing goes mad and the tiles will be really long. However i would also like the text to display on the category page where the products under it would be displayed and i don't need any limited characters.
Here is my code:
/* Enter your custom functions here */
add_action('woocommerce_after_subcategory_title', 'my_add_cat_description', 12);
function my_add_cat_description ($category) {
$cat_id=$category->term_id;
$prod_term=get_term($cat_id,'product_cat');
$description=$prod_term->description;
echo '<div class="shop_cat_desc">'.$description.'</div>';
}
Here is my site homepage where you can see the description: https://airsoftcentral.co.uk/
Here is my site where the description is limited: https://airsoftcentral.co.uk/product-category/clothing/
Please let me know if you can advise!
Thanks
James