[Support request] Length of text

Home Forums Support [Support request] Length of text

Home Forums Support Length of text

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2241215
    Max

    Hi is it possible to put a maximum on the words that appear?
    On mobile i want a option that you get. ”Read more” cause right now you see only text and not the picture of the products. So i want for example that only 20 words appear and the other ones only appear if people press on read more.

    #2241284
    David
    Staff
    Customer Support

    Hi there,

    is that for the category description ?

    #2241286
    Max

    Yes

    #2241334
    David
    Staff
    Customer Support

    OK, so you will need to tell Woo you want to be able to add HTML inside the description field. This doc provides the PHP Snippet you need to add to your site for that:

    https://woocommerce.com/document/allow-html-in-term-category-tag-descriptions/

    Then you will need some HTML, JS and CSS to create the read more / less function.
    I found an example here:

    https://stackoverflow.com/a/53011670

    HTML goes in the Product description field.

    The Javascript you can add to a HooK Element and select the wp_footer hook, and make sure to add the code inside script tags ie,

    <script>
    Javscript here
    </script>

    And the CSS goes wherever you normally add it.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.