Hide Menu on product pages with a certain 'Product Organization' Type in Dawn theme?

Topic summary

A user seeks to hide the header/menu on product pages where the product type equals “Affiliate” in the Dawn theme. They referenced a 2022 solution that no longer applies, as Dawn’s structure has changed—{% section 'header' %} no longer exists in theme.liquid.

Key developments:

  • Initial guidance: One responder suggested wrapping {% render 'header' %} in theme.liquid with a conditional check for product type “Affiliate”. However, the user couldn’t locate this code.

  • Working solution: Another contributor provided two approaches in sections/header.liquid:

    1. Wrapping header HTML with {% if template.name != 'product' or product.type != "Affiliate" %}—this caused a JavaScript error on line 316
    2. An alternative method (details shown via screenshots)—this successfully resolved the issue

Resolution: The second solution worked. The user, being new to Shopify, initially marked their own response as the solution but later corrected this after being asked to credit the actual helper. They also requested the working solution be separated from the failed attempt for clarity.

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

I have found this answer how to hide menu by collection here

but: the answer is from 2022 and I can’t locate {% section ‘header’ %} in the theme.liquid file of Dawn and I need to hide the menu when a product is ‘Type’ = Affiliate.

Alternativel I could create an Affiliate Collection of products but still unable to loacate {% section ‘header’ %}. Has the code changed since? I am new to Shopify and would appreciate the help.

1 Like

hey @Ocho share the URLs of your website plz

https://insuranceexamqueen.myshopify.com/
Sorry, was that compulsory? My bad

@Ocho , hey, thanks for posting here.

Yes, the Dawn theme’s structure has changed since 2022. Shopify has moved most layout rendering to main-product.liquid or main.liquid, and the header is now included inside the layout/theme.liquid file using {% render ‘header’ %} instead of {% section ‘header’ %}.

To hide the menu (header) on product pages with Product Type = “Affiliate”, follow these steps:


Step-by-step Guide1. Open layout/theme.liquid

Look for this line:

{% render 'header' %}
  1. Wrap it in a condition like this:
{% unless template contains 'product' and product.type == 'Affiliate' %}
  {% render 'header' %}
{% endunless %}

3.Save the file.


This will hide the header (menu) only on product pages where the product’s type is exactly “Affiliate”.

If you want to be safe and avoid Liquid errors on non-product pages, you can add a check like this:

{% if template contains 'product' and product %}
  {% unless product.type == 'Affiliate' %}
    {% render 'header' %}
  {% endunless %}
{% else %}
  {% render 'header' %}
{% endif %}

Let me know if you need help hiding other elements too.

Hi @Ocho ,

Go to: sections/header.liquid

Wrap the main header or navigation HTML with this Liquid condition:

{% if template.name != 'product' or product.type != "Affiliate" %}
  
 
{% endif %}

Thanks!

Thank you for taking the time to answer

unable to find render ‘header’ using the command F search. Only render ‘meta-tags’ and ‘cart-drawer’ :disappointed_face:

Hi @Ocho,

Go to: sections/header.liquid

Wrap the main header or navigation HTML with this Liquid condition:

{% if template.name != 'product' or product.type != "Affiliate" %}
  <!-- Your existing header code -->
 
{% endif %}

  1. Another Solution

Thanks!

1 Like

@Ocho sorry for that.

so please search header.liquid in theme files

no render ‘header’ in there either. only header-drawer and header-search

I’m getting an error in line 316 and unable to save file

Solution 2 WORKED

Thank you

Kindly mark the solution I provided. You have marked your own answer instead. @Ocho

Could you separate Answer 1 from Answer 2? Answer 1 didn’t work and caused an error

Like I said, I am new…first timer.

Undid my ‘solution’
and secondly, could you edit your reply as solutions one caused a javascript error and only Solution 2 worked. :disappointed_face: