My category description is long, so I would like to add a link (Read more…) to divide the texts (leave little text and when you click Read more… the rest of the text appears). But the function !–more– does not work in the category description. What other alternatives are there? I did some research but did not find anything valid Thanks
I understand you’re trying to add a “Read More” link to your lengthy category descriptions.
Just to clarify, this particular forum is meant for general support with the core functionality of WooCommerce itself. For development and custom coding questions, it’s best to ask for insight related to those on either the?WooCommerce Advanced Facebook group?or the?WooCommerce Community Slack. Many of our developers hang out there and will be able to offer insights into your question.
I wish I could help more, but hopefully, this gets you going in the right direction to get some further insight/information.
Yes that’s what I want, maybe I was thinking that there is a simpler solution that doesn’t need special codes, since the !–more– function is not available for the description. Maybe a simple HTML code
Just to clarify, this is beyond the scope of support we can offer, however, I’ll leave this topic open a little longer to see if any community member can chime in to help you out.
I’ve been going crazy trying to figure out how to do this as well. The read more widgets in page builders only work with post content, not archive descriptions, and I’ve spent 2 days with GPT4o and Gemini Pro trying to figure out how to make it happen with code but none of the J Query, Javascript, PHP or CSS works. I’ve searched the web for an answer and nothing there either, just tons of people with the same question. Would be AMAZING if WooCommerce would be kind enough to help us out with some custom code.
The !-more function in category description doesn’t work because it’s stripped out by WordPress itself (it’s not something that WooCommerce has any direct control over). You can see the same thing happening for “categories” when using regular blog posts.
In terms of possible solutions: A great deal depends on how the category description is displayed on the front end as each theme changes the classnames. On Storefront, I used the following custom CSS:
.term-description { /* Set initial fixed height */ max-height: 200px; /* Adjust this value as needed */