Shopify themes, liquid, logos, and UX
Hi there,
I have a large amount of (collection) pages that have customized design elements, so the standard header/footer is not needed.
Is there an easy way to exclude the header / footer on those?
F.i., through a specific meta-field in each collection?
Hey @kbac ,
Yes! A great way to conditionally exclude the header and footer on specific collection pages is by using a metafield on each collection. Here’s how you can do it:
Steps to Implement:
1. Add a Metafield to Collections:
- In your Shopify admin, go to Settings > Custom Data > Collections.
- Click Add definition, name it something like hide_header_footer.
- Set the type to Boolean (true/false) so you can easily toggle it.
- Save and then assign true to the collections where you want to hide the header/footer.
2. Modify Your Shopify Liquid Theme Code:
- In your collection.liquid (or main-collection.liquid if you're using Shopify 2.0), wrap your header and footer with a condition like this:
{% if collection.metafields.custom.hide_header_footer != true %}
{% render 'header' %}
{% endif %}
<!-- Your collection page content here -->
{% if collection.metafields.custom.hide_header_footer != true %}
{% render 'footer' %}
{% endif %}
3. Alternative Approach (Using Templates):
- If you have significantly different layouts, you could create an alternative collection template (collection.custom.liquid) and assign it manually to collections in the admin.
Would you like help with setting up these metafields programmatically via the Shopify API? Please Feel Free to reach out!
If I was able to help you, please don't forget to Like and mark it as the Solution!
Best Regard,
Rajat
Thank you.
I cannot find any file that contains something like render header etc.
There is no collection.liquid (or main-collection.liquid if you're using Shopify 2.0) or similar.
HI @kbac
Could you share the store link with me?
Also, which pages do you want to hide the header/footer on? Please share 3-4 links so I can check and assist accordingly.
Best,
Daisy
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