Hello, I had an agency create a custom theme for me and everything looked great. However, recently the first paragraph on product pages has been showing up twice. The agency has been unresponsive so I’m looking to just fix it myself.
This page has the problem: Fish Maw (Single Ingredient Chew) – Pezzy Pets
But this product page is displaying correctly: Silver Carp Chips (Single Ingredient) – Pezzy Pets
Anyone know how to fix this issue?
Hi @mike_acari ,
Yes, I think the content might have been added twice. Please check and remove the duplicate.
If you can share a screenshot or any details, I’ll be happy to help you fix it.
Thank you
The paragraph is there twice because it’s included in the Second Section of Read More/Read Less
Thank you, but I already checked and it hasn’t been added twice. Here’s a screenshot from the product editing page
Ok but how would I remove it then? The other content is also included in the second section of read more but only shows up once.
I would double check the product is based on the same template. Lower right corner of the edit product screen. If products have different things, that’s where most problems are, especially if things are custom made. Then look at the product in the theme editor.
Hello, @mike_acari
1. Go to Online Store → Theme → Edit code.
2. Open your theme.css / base.css file and paste the code in the bottom of the file.
section#ProductInfo-template--16840101888198__main .content.add-read-more.show-more-content > p {
display: none !important;
}
Thank You!
Thank you! That fixed the issue on the affected pages but now when I click “read more” on pages that were working fine before, the previously viewable content disappears. Like on this page: Silver Carp Chips (Single Ingredient) – Pezzy Pets
Any idea how to remedy that?
Are those products using different templates? If so settings for the template/section etc is probably the issue such as duplicate blocks or dynamic sources
Hey this issue happens when you paste the code provided by @websensepro
Could you make sure to remove the previous code and paste the current one code as I shared the steps below.
Go to Shopify Admin >> Online Store >> Edit Code >> theme.liquid
In the theme.liquid file right before the body tag closing paste the following code shared below.
{% if product.handle == 'single-ingredient-silver-carp-chips' %}
<style>
section#ProductInfo-template--16840101888198__main
.content.add-read-more.show-more-content > p {
display: none !important;
}
</style>
{% endif %}
If this was helpful don’t forget to like it and mark as Solution.
Thank you, but wouldn’t that code only apply to the silver carp chips page? With the previous code, it fixed the issue of duplicate paragraphs but now it’s cutting off the first paragraph on pages that didn’t have the issue before. All the products are on the same template.
Yes, it would only apply to that product. You’d have to apply it to the other affected products as well, if any.
If all products are on the same template, I think your issue is within the “Read More/Read Less” function itself. Do you have the ability to temporarily disable it, and just display the description as written? The section is accordion anyway, and the description is not that long. Perhaps you have a past duplicate theme that you can use?
This functionality is added by a small Javascript code in your assets/custom.js
The code supposed to split your product description in 2 parts – excerpt (no more then 204 characters) and the rest and show them immediately and after “read more” is pressed.
However, the code seem to slip if your first paragraph of description is longer than 204 characters.
Simple solution is to ensure that first paragraph of your description is shorter than 204 characters.
Otherwise it’s necessary to modify the AddReadMore function in the file mentioned above.
If necessary, I can rewrite this JS code, please DM me here in forum.