Viewing 2 replies - 1 through 2 (of 2 total)
  • add_filter('woocommerce_short_description', 'limit_product_short_description', 10, 1);
    function limit_product_short_description($post_excerpt) {	
    	$limit = 14;
    	
    	$pieces = explode(" ", $post_excerpt);
    	$post_excerpt = implode(" ", array_splice($pieces, 0, $limit));
    	
    	return $post_excerpt;
    }

    explode breaks the original string into an array of words, array_splice lets you get certain ranges of those words, and then implode combines the ranges back together into single strings.

    We haven’t heard back from you in a while, so I’m going to mark this as resolved. Feel free to start a new thread if you have any further questions!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to extend product short description ?’ is closed to new replies.