I’d like one of my collection to show a different header and a different footer, while other collections follow the default one/ another one.
Topic summary
A user wants to implement different headers and footers for specific collections in the Warehouse theme.
Current situation:
- Some collections should display custom header/footer combinations
- Other collections should maintain the default header/footer or use alternative versions
Status: The question remains unanswered with no solutions or suggestions provided yet.
Hello @nickisusanalex ,
If you already designed the different header and footer then go to theme.liquid here search for {% render ‘header’ %} and {% render ‘footer’ %} or {% sections ‘header’ %} or {% sections ‘footer’ %} or something similar.
Once found wrap each with a condition
For example, if you want a different header/footer for a specific collection (say handle summer-sale):
{% if template contains ‘collection’ and collection.handle == ‘summer-sale’ %}
{% section ‘header-summer’ %}
{% else %}
{% section ‘header’ %} // default header
{% endif %}
And similarly for footer:
{% if template contains ‘collection’ and collection.handle == ‘summer-sale’ %}
{% section ‘footer-summer’ %}
{% else %}
{% section ‘footer’ %}
{% endif %}