how can i remove announcement bar and footer menu on my cart page only

Topic summary

A user wants to remove the announcement bar and footer menu specifically from their cart page while keeping other elements intact.

Initial Solution:

  • Add CSS code to the theme.liquid file (before the tag) that hides elements when template.name equals ‘cart’
  • This targets the cart page only

Refinement:

  • The original code removed the entire header section, including the menu bar
  • User requested to keep the top menu bar visible and only remove the two announcement bars
  • Updated CSS code provided to preserve the header while hiding only the announcement sections

Implementation Steps:

  1. Navigate to Shopify admin → Online Store → Themes
  2. Click Actions → Edit code on the active theme
  3. Locate theme.liquid file
  4. Insert the conditional CSS code before tag
  5. Save changes

Screenshots were shared showing the expected results with the header menu remaining visible while announcement bars are hidden on the cart page.

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

Is there a way to edit the code so it would still show the menu bar on top and just delete the 2 announcement bars? Now it deleted the entire header section. tnx