Hide Header Icons Homepage

Hi!

I want to hide all the header icons (search, cart and menu) only on the homepage, but they should be visible on all other pages. Both on mobile and desktop.

My theme is Stiletto and my web is www.winnerofficial.com

I tried many codes and nothing works!

Hello @martujv

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 on theme.liquid
    {%- if template == β€˜index’ -%}

.header__icon-touch:last-child, ul.header__links-list.fs-navigation-base, a.header__icon-touch.header__icon-touch--search.no-transition, a.header__icon-touch.header__icon-touch--search.no-transition, .drawer-menu.visible .drawer-menu__panel, button.header__menu-icon.header__icon-touch.header__icon-menu { display: none !important; }

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

The cart icon is still there, any solution?

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 on theme.liquid
    {%- if template == β€˜index’ -%}

.header__row .header__row-segment.right { display: none !important; }

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

1 Like

Hello @martujv

This is Amelia at PageFly - Shopify Advanced Page Builder app.

You can try the following steps I have provided to help you solve the problem you are facing:

You can try the following steps I have provided to help you solve the problem you are facing:

Step 1: Online Store β†’ Themes β†’ Edit Code

Step 2: Choose file theme.liquid

Step 3: Add code above the tag

{% if template == 'index' %}
  
{% endif %}

Hoping my solution helps you solve your problem.

Best regards,

Amelia | PageFly

1 Like