Liquid, JavaScript, themes, sales channels
hi all,
im using a code to add an image to my header. how can i exclude my homepage from this code? also how can i change the color of my font on my homepage header without it effecting all my other pages?
this is the code im using
.header {
background: url(https://cdn.shopify.com/s/files/1/0736/1419/7046/files/212Why_Choose_Us_Travel_Agency_6.png?v=169527...);
background-repeat: no-repeat;
background-position: center;
background-size: cover;
}
Hi @FWF
You can use this code in theme.liquid file to check page is homepage so you can apply code to homepage only or not apply code to homepage
{% if template == 'index' %}
{% endif %}
- Helpful? Like and Accept a solution. - Donate: Buy coffee ☕- or Paypal me ❤️
- Ryviu - Product Reviews app, collect consumer photo reviews, import reviews from AliExpress, Amazon, Etsy, Shoppe and Walmart and CSV.
- Lookfy app: Create Image Lookbook, Photo Gallery with product hotspots
- Enjoy 3 months of Shopify for $1/month. Sign up now
what can i add in the middle of that code to say no or false or something?
{% if template == 'index' %}
// this is homepage
{% else %}
// this is not homepage
{% endif %}
- Helpful? Like and Accept a solution. - Donate: Buy coffee ☕- or Paypal me ❤️
- Ryviu - Product Reviews app, collect consumer photo reviews, import reviews from AliExpress, Amazon, Etsy, Shoppe and Walmart and CSV.
- Lookfy app: Create Image Lookbook, Photo Gallery with product hotspots
- Enjoy 3 months of Shopify for $1/month. Sign up now
something like this
{% if header == 'index' %}
background:
false
{% endif %}
{% if template == 'index' %}
// this is homepage - you must add css code into style tags
<style>
</style>
{% else %}
// this is not homepage - you must add css code into style tags
<style>
</style>
{% endif %}
- Helpful? Like and Accept a solution. - Donate: Buy coffee ☕- or Paypal me ❤️
- Ryviu - Product Reviews app, collect consumer photo reviews, import reviews from AliExpress, Amazon, Etsy, Shoppe and Walmart and CSV.
- Lookfy app: Create Image Lookbook, Photo Gallery with product hotspots
- Enjoy 3 months of Shopify for $1/month. Sign up now
User | RANK |
---|---|
37 | |
24 | |
13 | |
13 | |
9 |
Transform this holiday season into a shopping spree. Plus, learn how to effortlessly open ...
By Jasonh Dec 8, 2023Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023