Shopify themes, liquid, logos, and UX
I have three landing pages I’m working on for social media that I am trying to hide the header and footer. I’m not skilled in coding and have tried adding it several times to no avail. Is anyone able to assist me?
https://authoremilysilver.com/pages/nashville-knights-release
https://authoremilysilver.com/pages/love-pucked-release
https://authoremilysilver.com/pages/author-emily-silver
Solved! Go to the solution
This is an accepted solution.
Hi @authoremilysilv ,
1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.liquid file
3. In theme.liquid, paste the below code after <body>
<script>
document.addEventListener('DOMContentLoaded', function() {
const pagesToHide = [
'/pages/nashville-knights-release',
'/pages/love-pucked-release',
'/pages/author-emily-silver'
];
const currentPath = window.location.pathname;
if (pagesToHide.includes(currentPath)) {
// Target the header and footer elements
const header = document.querySelector('.header-wrapper');
const footer = document.querySelector('.footer');
if (header) {
header.style.display = 'none';
}
if (footer) {
footer.style.display = 'none';
}
}
});
</script>
If my reply is helpful, kindly click like and mark it as an accepted solution.
Thanks!
Use our Big Bulk Discount app to boost your sales! 🚀 (https://apps.shopify.com/big-bulk-discount). Easy to set up and perfect for attracting more customers with bulk discounts. Try it now and watch your revenue grow!
Hi,
Hope this will work
- Create a Special Page Template
- Edit Template to Remove Header/Footer
Once the new template opens, it’ll look something like this:
{% section 'header' %}
{{ page.content }}
{% section 'footer' %}
remove the header and footer sections, so change it to:
{{ page.content }}
- Assign This Template to Your Landing Pages
This is an accepted solution.
Hi @authoremilysilv ,
1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.liquid file
3. In theme.liquid, paste the below code after <body>
<script>
document.addEventListener('DOMContentLoaded', function() {
const pagesToHide = [
'/pages/nashville-knights-release',
'/pages/love-pucked-release',
'/pages/author-emily-silver'
];
const currentPath = window.location.pathname;
if (pagesToHide.includes(currentPath)) {
// Target the header and footer elements
const header = document.querySelector('.header-wrapper');
const footer = document.querySelector('.footer');
if (header) {
header.style.display = 'none';
}
if (footer) {
footer.style.display = 'none';
}
}
});
</script>
If my reply is helpful, kindly click like and mark it as an accepted solution.
Thanks!
Use our Big Bulk Discount app to boost your sales! 🚀 (https://apps.shopify.com/big-bulk-discount). Easy to set up and perfect for attracting more customers with bulk discounts. Try it now and watch your revenue grow!
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025