Show a section in just one page

Topic summary

A user has a video banner section appearing on all pages of their Shopify store, but wants it to display only on the homepage.

Problem:

  • Video banner is stuck in the header across all pages (including product pages)
  • The banner was created using a custom liquid section

Solution Provided:
Wrap the custom liquid code with a conditional statement:

{% if template == 'index' %}
your code goes here
{% endif %}

This Liquid template tag restricts the video banner to display only when the homepage template is active. The discussion remains open as the user hasn’t confirmed implementation of the suggested solution.

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

Hi,

I’ve a video banner at the top of my home page which is stuck on all my pages. So when I’m at a product page the video banner is still there… How can I tell this video banner section to only stay at the home page/screen?

1 Like

What’s your website url ?

Hi @adam1910

Did you add customized code for that video banner section?

If it is correct, please wrap your code in the following code to display it on the homepage only.

{% if template == 'index' %}
your code goes here
{% endif %}

Yes it’s a section in the header…

It’s a custom liquid with a video banner. Is there a code I can insert in the custom CSS? Or what do you mean

I mean you wrap your custom liquid code in the code I sent above