All things Shopify and commerce
I want to remove the footer from all pages and leave it only on the home page, can anyone help me?
Solved! Go to the solution
This is an accepted solution.
Hi @KhallP
Check this one.
From your Shopify admin dashboard, click on "Online Store" and then "Themes"
Find the theme that you want to edit and click on "Actions" and then "Edit code".
In the "theme. Liquid" file. Find the </body> tag and paste the code below before the tag.
{% if template.name != 'index' %}
<style>
footer.footer.color-background-1.gradient.section-sections--16302501757028__footer-padding {
display: none;
}
</style>
{% endif %}
And Save.
Please don't forget to Like and Mark Solution to the post that helped you. Thanks!
Hello @KhallP -
Zach from TaskHusky here.
Here are some general instructions on how to accomplish this:
Access Your Theme Files:
From your Shopify admin, go to Online Store > Themes.
Find the theme you want to edit, and then click Actions > Edit code.
Locate the Footer Code:
The footer code might be in different files depending on the theme. Commonly, it is in theme.liquid, footer.liquid (inside the sections folder), or theme.liquid might include it from another file using a {% include %} or {% section %} tag. Look for the code that is responsible for displaying the footer.
Edit the Code:
Once you've found where the footer is included, wrap the footer code or the include/section tag that loads the footer with an if statement that checks if the current page is the homepage. You can check if it's the homepage by using request.path or template object like this:
liquid
Copy code
{% if request.path == '/' %}
<!-- Footer code or include/section tag goes here -->
{% endif %}
Or, using the template object:
liquid
Copy code
{% if template.name == 'index' %}
<!-- Footer code or include/section tag goes here -->
{% endif %}
Save the Changes:
After adding the conditional statement around the footer code, save your changes.
Test the Change:
Go to your storefront and refresh the page to ensure that the footer only appears on the homepage and not on other pages.
This is an accepted solution.
Hi @KhallP
Check this one.
From your Shopify admin dashboard, click on "Online Store" and then "Themes"
Find the theme that you want to edit and click on "Actions" and then "Edit code".
In the "theme. Liquid" file. Find the </body> tag and paste the code below before the tag.
{% if template.name != 'index' %}
<style>
footer.footer.color-background-1.gradient.section-sections--16302501757028__footer-padding {
display: none;
}
</style>
{% endif %}
And Save.
Please don't forget to Like and Mark Solution to the post that helped you. Thanks!
HI @KhallP
You can try this step to achieve your result
Step 1: You need to change your footer.liquid file code
This is your previous code looks like this
and your output is
Step 2: But if you change some code like this
Just add one condition
After doing this the result is
Code:
{% if request.path == routes.root_url %}
<footer></footer>
{% endif %}
Joy Matubber| Brain Station 23
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more contact us : [email protected]
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024