Re: transparent header only homepage

transparent header only homepage

goblender
Tourist
22 0 1

I have followed the instructions on this page:

https://websensepro.com/blog/how-to-show-transparent-header-in-dawn-13-0-0/

 

for transparent header in theme dawn. It works good. But it also applies on other pages. I only want it to apply on homepage. 

 

Thank you.

Replies 4 (4)

PaulNewton
Shopify Partner
6722 610 1433

Hi @goblender  👋 Check if the template is the index (homepage aka main landing page) as a condition

{% if request.page_type == 'index' and section.settings.enable_transparent-header %}

https://shopify.dev/docs/api/liquid/objects/request 

 

Save time & money ,Ask Questions The Smart Way


Confused? Busy? Get the solution you need paull.newton+shopifyforum@gmail.com


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org


BSSCommerce-HDL
Shopify Partner
1937 678 809

Hi @goblender, When you get to this step

 

BSSCommerceHDL_0-1721523184688.png

You should add it as follows: 
We need to create a new style tag and wrap it in a condition just for the home page

 

{% if template.name == 'index' %}
    <style>
       {% if section.settings.enable_transparent-header %}
    .header-wrapper{
      background: transparent !important;
    position: absolute !important;
    width: 100% !important;
    top: 0px;
  }
  {% endif %}

  {% if section.settings.color-transparent %}
@media only screen and (min-width: 600px) {
    .list-menu__item, details[open]>.header__submenu {
  color: {{ section.settings.color-transparent }} !important;
      background: transparent;
    }
  
}
  .header__icon.link,.header__active-menu-item,.disclosure__button,.header__heading-link .h2{
  color: {{ section.settings.color-transparent }} !important;
    }
    {% endif %}
    </style>
{% endif %}

 

Hope this can help you,

If our suggestions are useful, please let us know by giving it a like or marking it as a solution. Thank you 😍

 

If our suggestions are useful, please let us know by giving it a like, marking it as a solution, or donating here .


B2B Solution & Custom Pricing | Product Labels by BSS


Need help from our expert? Kindly share your request with us via community@bsscommerce.com


BSS Commerce - Full-service eCommerce Agency

niraj_patel
Shopify Partner
2378 514 511

Hello @goblender 

You can add code by following these steps

1. Go to Online Store -> Theme -> Edit code.
2. Open your theme.liquid file

3. Paste the below code before </body> on theme.liquid
 {% if template == 'index' %}
    <style>
        .elementor-9746 .elementor-element.elementor-element-9071f05:not(.elementor-motion-effects-element-type-background){
            background: transparent !important;
            position: absolute !important;
            width: 100% !important;
            top: 44px;
       }
    </style>
  {% endif %}

techlyser_web_0-1721493264506.png

Was my reply helpful? Click Like to let me know!
Was your question answered? Mark it as an Accepted Solution.

Shopify Partner || Helping eCommerce Stores
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution.
- For further discussion contact: Email ID- info@techlyser.com

PageFly-Richard
Shopify Partner
4564 1046 1707

This is Richard from PageFly - Shopify Page Builder App

 

Hi @goblender  Please add code here to fix it:

Step 1: Online Stores > Themes > Edit code

Step 2: Choose file theme.liquid
Step 3: Add code above the tag </body>

 

{% if template.name == 'index' %}
    <style>
     #content{
           margin-top: -100px;
      } 
      </style>
{% endif %}

 

Hope my solution will help you resolve the issue.

 

Best regards,

Richard | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


➜ Optimize your Shopify store with PageFly Page Builder (Free plan available) 


All features are available from Free plan. Live Chat Support is available 24/7.