Removing header and footer from landing page

barkinghugs
Tourist
4 0 1

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

 

Replies 6 (6)

Sandro_J_Monte
Shopify Partner
9 0 5

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 %}

 



I'm a Shopify obsessed and workaholic for more than 10 consecutive years work as Senior Shopify Developer. Any Advance Theme Customization and Tailored Theme development just contact me. Very low cost charge but high quality and optimized deliverable.
barkinghugs
Tourist
4 0 1

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

PageFly-Henry
Shopify Partner
1157 326 280

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:

PageFlyHenry_0-1715908245185.png

 



<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.

barkinghugs
Tourist
4 0 1

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

ZestardTech
Shopify Expert
5603 1019 1346

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 %}
Want to modify or develop new app, Hire us.
If helpful then please Like and Accept Solution .
Email: support@zestard.com
Shopify Apps URL :- https://apps.shopify.com/partners/zestard-technologies
Custom Modifications Into Shopify Theme | Shopify Private App | SEO & Digital Marketing
barkinghugs
Tourist
4 0 1

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 %}