Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #722549

    hi there

    i need some help on limiting the characters or length that shows on the product descriptions of the products on the Product Overview page
    and the product grid if possible. as you can see on my page.. they have different length that shows the thumbnails in different sizes.

    thank you

    #723458

    Hey fluidsuccess,

    I checked the page and I think the description isn’t really the problem but some images needs to be adjusted, try to upload images with a width and height of atleast 300px.

    Best regards,
    Nikko

    #723515

    hi nikko

    thanks for the reply. i think i can handle the images. what im asking is the text title/ description. i want to limit the text that shows there somehow and make them all uniform like say showing only 2 lines. see even if i have the same thumbnail images in one row..they still dont have the same height because some title/descriptions are longer. can you help?

    #724628

    Hi,

    Try adding this code at the bottom of functions.php:

    function short_product_titles_chars( $title, $id ) {
      if ( ( is_shop() || is_product_tag() || is_product_category() ) && get_post_type( $id ) === 'product' ) {
        if ( strlen( $title ) >= 75) {
          return substr( $title, 0, 75 ) . '...';
        } else {
          return $title;
        }
      } else {
        return $title;
      }
    }
    add_filter( 'the_title', 'short_product_titles_chars', 10, 2 );

    Just change 75 (limit to number of characters). Hope this helps.

    Best regards,
    Nikko

    #725142

    hey nikko

    i think this did the trick! this is what im looking for.

    thanks

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Limit the product description length in the Overview Product Page Woocommerce’ is closed to new replies.