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.
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025