I want to remove the footer from all pages and leave it only on the home page, can anyone help me?
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 == â/â %}
{% endif %}
Or, using the template object:
liquid
Copy code
{% if template.name == âindexâ %}
{% 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.
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 tag and paste the code below before the tag.
{% if template.name != 'index' %}
{% 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
After doing this the result is
Code:
{% if request.path == routes.root_url %}
{% 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 : js.team@brainstation-23.com

