How can I add code to the header of the homepage?

Hello everyone ! I have a piece of HTML code. I want to attach it to the header of the homepage. Home page only. I found the header.liquid file but it seems to show up on the whole website. Can someone help me with this problem?
Thanks everyone!

Hello @NQuan088

You can add code to the header.liquid like this

{% if template contains 'index' %}
//Your code here
{% endif %}

I hope the above is useful to you.

Kind & Best regards,
GemPages Support Team

You can be in the [edit code => layout=> theme.liquid] add

{% if template.name == "index" %}
       //your code here....
{%endif%}

I did it. Thank you very much :heart: