Shopify themes, liquid, logos, and UX
Hi,
I'm not a developer and I'm new to Shopify. I want to have my landing pages have no header or footer.
I tried this https://community.shopify.com/c/shopify-design/remove-header-and-footer-from-theme-on-new-template-s... and it works for the templates like index, product, collections.
However I can't get it to work for the custom templated pages that I've added for landing pages.
I did an ugly work around:
{% if template.name contains 'product' or template.name contains 'index' or template.name contains 'collection' or template.name contains 'search' %}
{% sections 'header-group' %}
{% endif %}
This solves the problem of the landing pages having the header and footer.
However, now all of the policy pages have no header or footer.
So I would either need to know how to include each of those in the 'or' statement above, or the cleaner way, which is to know how to refer to my landing pages in the statement below:
{% unless template.name contains 'landing' %}
{% sections 'header-group' %}
{% endunless %}
The template names I'm working with are landingpage and landingpagefb.
Thanks in advance for your help!
Paul
Replace your code and use {% unless %} instead.
I assume your landing page is used page template. Replace the 'landing-page-handle' with the handle of your landing page
{% unless template.name == 'page' and page.handle == 'landing-page-handle' %}
{% sections 'header-group' %}
{% endunless %}
Hi Sandro
thanks for the response. Can you tell me what a 'handle' is, and how to find the handle for my landing page?
thanks
Paul
Hi @barkinghugs
This is Henry from PageFly - Landing Page Builder App
You can try this code by following these steps:
Step 1: Go to Online Store->Theme->Edit code.
Step 2: Search file theme.liquid
Step 3: paste bellow code like this:
<style>
{% if page.url == '/pages/contact-us' %}
Header, footer {
Display: none !important;
{% endif %}
</style>
Note that you need to copy the URL and add code like this "/pages/contact-us"
In case the above code does not work, please share with me the editor url and password page. So I can examine this issue more closely.
Hope that my solution works for you.
Best regards,
Henry | PageFly
Please let me know if it works by giving it a Like or marking it as a solution!
PageFly - #1 Page Builder for Shopify merchants.
All features are available from Free plan. Live Chat Support is available 24/7.
Hi Henry,
thanks for getting back to me.
I tried your suggestion, and it worked for one of the URLs ('/pages/contact') , but not the other two. Any idea of why?
{% if page.url == '/policies/refund-policy' %}
{% sections 'header-group' %}
{% endif %}
{% if page.url == '/pages/contact' %}
{% sections 'header-group' %}
{% endif %}
{% if page.url == '/policies/terms-of-service' %}
{% sections 'header-group' %}
{% endif %}
Paul
Hello There,
1. In your Shopify Admin go to online store > themes > actions > edit code
2. Find Layout > theme.liquid and paste this at the bottom of the file:
{% unless template.name contains 'landingpage' %}
{% sections 'header-group' %}
{% endunless %}
Thanks for your suggestion, but it did not solve my problem. It does work when I try it for other types of things, such as the code below, but not for the page templates.
{% unless template.name contains 'product' %}
{% sections 'header-group' %}
{% endunless %}
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025