Shopify themes, liquid, logos, and UX
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 <style>
{% if template contains 'product' %}
//your code to remove header
{% endif %}
where to add this code
Go to main-product.liquid file and go to bottom of the page.
If you see style section which is indicated by <style> or <style type="type/css">, add above code inside it
If you don't see style section add following code at the bottom of the main-product.liquid file
<style type="type/css">
{% if template contains 'product' %}
header {
display: none;
}
{% endif %}
</style>
OR post your preview link so that I can see the code
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 </body> tag and paste the code below before the tag.
{% if template == 'product' %}
<style>
/* place the css style here */
</style>
{% 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!
didnt worked
oh, what theme your using?
Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-TekLabs to discuss practical strategies for...
By JasonH Nov 13, 2024The year-end shopping spree is around the corner! Is your online store ready for the ...
By JasonH Nov 10, 2024