Why is my 'read more' button creating duplicate text on category pages?

Hey folks,

here we are again!!

I’ve insert this code to create “read more” and “read less” button on all my category pages but, I don’t know why my text become duplicate.

Please can you check my code and let me know where I wrong?

Thank you so much!!

{% assign collection_strip = collection.description | strip %}
{% if collection_strip != "" %}
{% assign paragraphs = collection.description | newline_to_br | split: '
'%}

{{paragraphs}}

  {% assign len = paragraphs | size %} {{paragraphs | slice: 2, len}}

  

{% endif %}

Hi @Niccolo8 ,
your code seems to be fine.

Could you please provide Shopify store URL in order to reproduce the issue?

Thanks,
Simone

Hi @cringe_studio ,

thank you so much for your reply.

I’ve fix the issu!

Thank you so much again!

1 Like