Title: Code for adding truncate to short description
Last modified: July 2, 2020

---

# Code for adding truncate to short description

 *  Resolved [Lori Boone](https://wordpress.org/support/users/pleazo/)
 * (@pleazo)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/code-for-adding-truncate-to-short-description/)
 * Hello,
 * I am trying to truncate the short description with the following code in woocommerce
   short description.php but ends up looking like this: [https://snipboard.io/JTZsym.jpg](https://snipboard.io/JTZsym.jpg).
   Does anyone know what I am doing wrong here? [https://www.pleazo.com/product/queer-eye-pin-copy/](https://www.pleazo.com/product/queer-eye-pin-copy/)
 * Best,
    Chris
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcode-for-adding-truncate-to-short-description%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Peter Lawrenson](https://wordpress.org/support/users/lorro/)
 * (@lorro)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/code-for-adding-truncate-to-short-description/#post-13065875)
 * Its best not to alter WooCommerce core files because any edits will get overwritten
   by plugin updates.
 * You can look for a code snippets plugin or make a child theme and put the code
   in functions.php for the child theme.
 *  Thread Starter [Lori Boone](https://wordpress.org/support/users/pleazo/)
 * (@pleazo)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/code-for-adding-truncate-to-short-description/#post-13067253)
 * Hi Iorro,
 * Thanks for your response. I am using a child theme and put the code in the functions
   php and now it works! Just wonder if there’s a way if after clicking “read more”,
   is there an option at the end of the text to have “read less” to make it shorter
   again? [https://www.pleazo.com/product/jojoba-oil-pure-natural-cold-pressed-e-jojoba-vegan-skin-cleanser-and-massage-oil-facial-skin-care-body-oil-100ml-4floz/](https://www.pleazo.com/product/jojoba-oil-pure-natural-cold-pressed-e-jojoba-vegan-skin-cleanser-and-massage-oil-facial-skin-care-body-oil-100ml-4floz/)
 * Also is there a code to do this for product thumbnails? I have an issue like 
   this one [https://snipboard.io/3UeWac.jpg](https://snipboard.io/3UeWac.jpg)
 * Best,
    Chris
 *  [Peter Lawrenson](https://wordpress.org/support/users/lorro/)
 * (@lorro)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/code-for-adding-truncate-to-short-description/#post-13067432)
 * That’s more code than would normally be seen in a forum answer but someone might
   do it. You’ll probably need a developer.
 *  Plugin Support [Tseten a11n](https://wordpress.org/support/users/tibetanitech/)
 * (@tibetanitech)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/code-for-adding-truncate-to-short-description/#post-13160408)
 * We haven’t heard back from you in a while, so I’m going to mark this as resolved–
   if you have any further questions, you can start a new thread.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Code for adding truncate to short description’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)
 * [truncate](https://wordpress.org/support/topic-tag/truncate/)

 * 4 replies
 * 3 participants
 * Last reply from: [Tseten a11n](https://wordpress.org/support/users/tibetanitech/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/code-for-adding-truncate-to-short-description/#post-13160408)
 * Status: resolved