Removing Header from Landing Pages

Highlighted
Tourist
14 0 1

Hey all,

 

Thanks for looking at my inquiry.

 

Basically, in order to remove the header from landing pages with my 'product.landing.liquid' template file, I am working towards a conditional to program out ’{% section ‘header’ %}' from the 'theme.liquid' file using the following logic —

 

{% if template.suffix == 'landing' %}
         {% include 'header' %}
         {% endif %}

However, I am caught up as to how to carry out the if/then. Any suggestions as to how to exclude the header from displaying within this single template while still displaying within all other templates? 

0 Likes
Trailblazer
233 27 29

one option can be, wrap header in some div and give it an d which is used in this landing page only, so that after page is displayed we can remove header with css

you are welcome to contact / donate small amount to me.
My email - suyash.patankar@gmail.com

paypal.me/suyashpatankar
0 Likes
Shopify Partner
1753 289 373

Hi @quintinradford 

Your try is good but you have one issue, it can be:

{% if template contains 'index' %}
       {% include 'header' %}
{% endif %}

 

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
0 Likes
Tourist
14 0 1

Thank you for your suggestions, everyone!

 

I was able to accomplish this using the following code —

 

{% if template.suffix != 'landing' %} {% section 'header' %} {% endif %}

 

0 Likes