Hi Shopify Community,
I’m currently working on my Shopify store and have a specific requirement for my featured collection section. I need to change the heading tags of the products listed under the “Best Selling” section from H2 to H3.
Here’s the current structure of my HTML headings:
H1 - Target Keyword
H2- Product Title
H2-Best selling
H2-Product Title
Both the Product Section comes under featured collection section whenever I’m making changes there both the tags are getting changed
I want to change the product headings under the “Best Selling” section to H3 tags for better SEO optimization and page structure. Can anyone guide me on how to achieve this?
Thank you in advance for your help!
Hello @adityasalunkhe ,
Welcome to the Shopify community.
To change the heading tags of products listed under the “Best Selling” section from H2 to H3 in your Shopify store, you will need to edit the theme’s Liquid templates. Here’s a step-by-step guide:
Step-by-Step Guide:1. Access Your Theme’s Code:
- In your Shopify admin, go to Online Store > Themes.
- Find the theme you are currently using and click on Actions > Edit code.
-
Locate the Featured Collection Template:
- Look for the file responsible for the featured collections. This is typically found in the Sections directory and might be named something like featured-collection.liquid or collection-template.liquid.
-
Edit the Heading Tags:
- Open the relevant Liquid file and search for the H2 tags within the “Best Selling” section.
- You should see something like this:
## {{ product.title }}
- Change the H2 tags to H3 for the “Best Selling” section:
{% if section.title == 'Best Selling' %}
### {{ product.title }}
{% else %}
## {{ product.title }}
{% endif %}
-
Save Your Changes:
- After making the necessary changes, save the file.
Example Code:
Here is an example of how you might modify the template to conditionally change the heading tags:
{% if section.title == 'Best Selling' %}
{% for product in section.products %}
### {{ product.title }}
{% endfor %}
{% else %}
{% for product in section.products %}
## {{ product.title }}
{% endfor %}
{% endif %}
Note:
The exact implementation may vary based on your theme’s structure. If the “Best Selling” section does not have a unique identifier, you might need to add one or use another method to distinguish it from other sections.
By following these steps, you can customize the heading tags for better SEO optimization and page structure. If you need further assistance, feel free to reach out.
Best regards