Coding help - Liquid error: Error in tag 'section' - 'announcement bar' is not a valid section type

Topic summary

Liquid error while adding a custom announcement bar in a Shopify theme: “Error in tag ‘section’ – ‘announcement bar’ is not a valid section type.” Liquid is Shopify’s templating language; a “section” is a theme component. The error indicates the theme doesn’t recognize an ‘announcement bar’ section type.

Latest details:

  • Code shared from header.liquid shows the announcement logic embedded (using section.settings for show_announcement, announcement_text, announcement_link), and the theme does not have a standalone announcement bar section.
  • Shopify support informed that this theme cannot have its announcement bar amended in the way attempted.

Actions/outcomes:

  • The user decided to work around the limitation rather than hire an expert.
  • Another participant offered to adjust the code to remove the error message, noting that any layout/styling changes would require additional CSS work and likely an expert.

Key artifact:

  • The header.liquid code snippet is central to understanding the issue.

Status:

  • No confirmed fix posted; offer to help with code exists. Discussion remains open with unanswered implementation details on how to modify the theme without a dedicated section.
Summarized with AI on February 12. AI used: gpt-5.

Noob coder needing assistance if possible… I am trying to add my own custom announcement bar onto my site but am receiving this error as above - Liquid error: Error in tag ‘section’ - ‘announcement bar’ is not a valid section type - What could be causing this? Is there one/a small number of possible errors? Or is there a long list of potential issues that could be causing this error?

TIA community members

Hi @Nootz ,

Please send me the code of ‘Announcement Bar’ file, I will check it for you.

@LitExtension - thank you, this is the code from the header.liquid section, in this theme the announcement bar does not have its own section.

{% if section.settings.show_announcement or shop.customer_accounts_enabled %}
{% if section.settings.show_announcement %} {% if section.settings.announcement_link != blank %} {% endif %}

{{ section.settings.announcement_text | escape }}

{% if section.settings.announcement_link != blank %}

{% endif %}
{% endif %}

@LitExtension I have asked shopify support about this possibility and they say it is no possible to amend the announcement bar for this theme. I’m not looking at spending $$$ on an expert to have a look at it so I will just work around it, but thank you for your response.

Hi @Nootz ,

Do you want me to fix it? I will help you to change the code so that it shows no error message.

But with layout, it will need more changes in CSS and you need to hire an expert for it if you want to change more.