How can I make my video section visible only on the home page?

Topic summary

A user seeks to restrict a video section’s visibility to only the homepage of their Shopify store.

Solution Provided:
Another participant offers a code snippet to be added to the theme.liquid file:

  • Navigate to: Online store > Themes > Edit code
  • Insert the code before the </head> tags
  • The code uses Liquid templating logic to check if the current page template is ‘index’ (homepage)

Outcome:
The original poster confirms the solution worked successfully.

Technical Context:
This involves Shopify theme customization using Liquid template language to conditionally display content based on page type.

Summarized with AI on November 16. AI used: claude-sonnet-4-5-20250929.

how do I do my video section visible only on the home page

https://2cdlg2c6nf0v3yvj-82296930600.shopifypreview.com

Hi @the-gallery

You can do that by adding this code to theme.liquid file in Online store > Themes > Edit code before tags

{% if template == 'index' %}

{% else %}

{% endif %}
1 Like

that you so much!