Hello @kasm2013 !
Sorry to hear you’re dealing with this issue!
You’re close — but the problem is that theme.liquid can’t reliably detect template.name for JSON-based templates (like page.landing-page.json), especially in Shopify’s newer Online Store 2.0 themes (like Ride, Dawn, etc.).
Best Practice: Use template or request object in theme.liquid
Instead of template.name, use:
{% if template == ‘page.landing-page’ %}
OR (for older themes):
{% if request.page_type == ‘page’ and request.template == ‘page.landing-page’ %}
So update your snippet to:
{% if template == ‘page.landing-page’ %}
.header-wrapper {
display: none !important;
}
footer.footer {
display: none !important;
}
{% endif %}
Alternative (cleaner): Remove header/footer in template file
Instead of hiding with CSS, you can remove the includes from the template itself:
-
Go to templates/page.landing-page.json
-
Remove or comment out “header-group” and “footer-group” from the sections array:
{
“name”: “Landing Page”,
“sections”: {
“main”: {
“type”: “main-page”,
“settings”: {}
}
// Do NOT include “header-group” or “footer-group”
},
“order”: [
“main”
]
}
This will render a completely headerless + footerless layout, without needing CSS hacks.
Debug Tip
You can temporarily print this in your theme.liquid to see what template Shopify thinks it’s using:
{{ template }}
{{ request }}
If this reply was useful to you, we would really appreciate it if you gave us a LIKE and mark the issue as SOLVED!