Meta Description for Collections(All) Page

Meta Description for Collections(All) Page

onawave
Excursionist
20 0 4

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 %}

 

Replies 3 (3)

SheetalZadfiya
Explorer
70 15 19

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!

 

If our answer is helpful then please feel free to Like and Accept it as solution!
Hire our Shopify Developers for all your small & big needs:
New Store Development | Custom Theme Development | Site Speed Optimization
Email: hello@mintyourstore.com | Instagram: @mintyourstore
onawave
Excursionist
20 0 4

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?

SheetalZadfiya
Explorer
70 15 19

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.

If our answer is helpful then please feel free to Like and Accept it as solution!
Hire our Shopify Developers for all your small & big needs:
New Store Development | Custom Theme Development | Site Speed Optimization
Email: hello@mintyourstore.com | Instagram: @mintyourstore