Hiding the header on multiple templates

Solved

Hiding the header on multiple templates

TLP0
Visitor
2 0 1

Looking for some guidance on how hide the header on more than just one template. Currently, I'm using the 'unless' condition to remove the header on a template we use for opt-ins, however, I had to create another template used for a video (page.masterclass-no-header) but I can't figure out how to add that template into the code. Everything I've tried removes the header from all templates including the homepage. 

 

Here is what I currently have:

Screenshot 2024-06-25 at 8.51.08 AM.png

TYIA!

Accepted Solution (1)

StevenDunneDev
Shopify Partner
57 14 10

This is an accepted solution.

This might seem like a bit of a hack but if your Unless statement is working for you I think you can just use an OR operator. This would get a bit much if you kept adding templates but for a couple it should be good:

{% unless template == "page.opt-in' or template == "new-template-you-want-to-exlude" %}

If my answer has been helpful to you, please give it a like and accepted solution. I greatly appreciate it 🙂

If you'd like to hire me to solve bigger problems for you, please reach out. I'd love to hear from you

View solution in original post

Replies 2 (2)

StevenDunneDev
Shopify Partner
57 14 10

This is an accepted solution.

This might seem like a bit of a hack but if your Unless statement is working for you I think you can just use an OR operator. This would get a bit much if you kept adding templates but for a couple it should be good:

{% unless template == "page.opt-in' or template == "new-template-you-want-to-exlude" %}

If my answer has been helpful to you, please give it a like and accepted solution. I greatly appreciate it 🙂

If you'd like to hire me to solve bigger problems for you, please reach out. I'd love to hear from you
TLP0
Visitor
2 0 1

Thank you, Steven! That worked! I appreciate it!