how to remove contents on header without affecting other pages

Topic summary

A user wants to remove header contents and the three-line menu icon (hamburger) from the homepage only, while keeping the logo and preserving the header on all other pages for both mobile and desktop.

Proposed Solutions:

Two community members offered similar CSS-based approaches:

  • Method 1: Add conditional CSS to theme.liquid using {% if request.path == "/" %} to target the homepage specifically
  • Method 2: Use {% if request.page_type == "index" %} instead, which also targets the homepage

Both solutions involve:

  1. Navigating to Online Store → Themes → Edit Code
  2. Opening the theme.liquid file
  3. Inserting custom CSS code just before the </head> tag

The CSS would hide specific header elements only when the homepage condition is met. One responder included a screenshot showing code placement. The discussion remains open with no confirmed resolution from the original poster.

Summarized with AI on October 29. AI used: claude-sonnet-4-5-20250929.

i’m looking to remove the contents also the 3 lines on the left side that i have hidden on the header home page without affecting the rest of the pages for mobile and desktop (please keep logo)

1 Like

Hi @undercoverfresh , you can follow these steps:

Step 1: Open Online Store → Themes → Edit code

Step 2: Find theme.liquid file

Step 3: Paste this code before close tag:

{% if request.path == "/" %}
      
{% endif %}

If this helpful, please let us know by giving us a like and marking it as a solution. Thanks

1 Like

Hi @undercoverfresh ,

I have written custom code for this solution. Please follow below steps and let me know your feedback.

Follow these Steps:

  1. Go to Online Store

  2. Edit Code

  3. Find theme.liquid file

  4. Add the following code just above tag

{% if request.page_type == "index" %}
      
    {% endif %}

If you require further help to optimize your store, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!

Best Regards,
Makka

1 Like

It very simple