how do i edit product page only whenever i remove header from product page it get removed from home page also i want to remove this custom liquid from products pages but when i do it gets removed from home page also help please
Hi,
Headers are rendered in theme.liquid, which means they will be generated for every page, and removing them means removing them globally.
So you must only add the remove header code if it is the product page. You can use the following logic to know the product page:
//Inside
{% if template contains ‘product’ %}
//your code to remove header
{% endif %}
Hi @Hoppop
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 == 'product' %}
{% endif %}
And Save.
Refresh the browser.
This code means it will apply the css style only in the product page.
Please don’t forget to Like and Mark Solution to the post that helped you. Thanks!
where to add this code
didnt worked
oh, what theme your using?
Go to main-product.liquid file and go to bottom of the page.
If you see style section which is indicated by or , add above code inside it
If you don’t see style section add following code at the bottom of the main-product.liquid file
{% if template contains 'product' %} header { display: none; } {% endif %}OR post your preview link so that I can see the code
