Personalized checkout and custom promotions with Shopify Scripts
Hello,
I am trying to add a meta description to the Collections>All Page.
I located the coding below in the forums. When inserting it into my theme. liquid it appears above my announcement bar. May someone advise what is wrong?
Thank you for any insight,
{% if template == 'list-collections' %} // Your custom <meta> tags <title>Little Rootz All Products</title> <meta name="description" content=“Our durable, high quality Children's Satin Durag and Bonnet are exclusively designed. Styles are available for all ages!" /> {% else %} // Normal action if it's not the /collections page {% endif %}
Hi @onawave,
I tried to figure out the reason why meta description appears above the announcement bar, and I have found that you have to add {% if template.name == ‘collection' %} condition instead of {% if template == 'list-collections' %}.
After adding it, the meta description will be applied only on the collection pages.
Use this:
{% if template == 'collection' %}
// Your custom <meta> tags
<title>Little Rootz All Products</title>
<meta name="description" content=“Our durable, high quality Children's Satin Durag and Bonnet are exclusively designed. Styles are available for all ages!" />
{% else %}
// Normal action if it's not the /collections page
{% endif %}
Cheers!
Thank you so much for your response.
I inserted that coding into my theme. liquid and it still appears above the announcement bar.
Should I be placing it elsewhere?
Hi @onawave,
I have added the condition in my theme and it’s working correctly. Can you please share the URL of the store and the screenshot of the code so I will help you to solve it?
Thank you.
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024