Hiding Header and Footer on Landing Page only... Craft Theme

Topic summary

A user needed help hiding the header and footer on a specific landing page in their Craft theme Shopify store. They had attempted several code solutions found in the community but none were working.

Problem:

  • Tried multiple CSS/Liquid code snippets to hide header and footer elements
  • Targeting a specific page URL: ‘/pages/lmsl-and-aegenda’
  • Previous attempts using display: none !important; on various selectors failed

Solution:
Another community member (BSSCommerce-B2B) provided working code that successfully resolved the issue.

Status: ✓ Resolved - The user confirmed the suggested code worked.

Summarized with AI on November 5. AI used: claude-sonnet-4-5-20250929.

I’ve tried other solutions in here for code to hide the header and footer on my landing page, but none of them are working for me. Any help is greatly appreciated!

So far I’ve tried:

{% if page.url == ‘/pages/lmsl-and-aegenda’ %}

div#shopify-section-foote, header#SiteHeader { display: none !important;; }

{% endif %}

and

{% if page.url == ‘/pages/landing-page’ %}

div#shopify-section-foote, header#SiteHeader { display: none !important;; }

{% endif %}

and a few others…

@Cthom1964 , try this one

{% if page.url == '/pages/lmsl-and-aegenda' %}
   
{% endif %}

And

{% if page.url == '/pages/landing-page' %}
 
{% endif %}

That worked! Thank you!