Make WordPress Core

Opened 12 months ago

#58538 new defect (bug)

Wrong menu is shown after adding new Header Template parts

Reported by: littleen's profile littleen Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.2.2
Component: Menus Keywords:
Focuses: Cc:


I believe I have found a repeatable bug, and workaround, pertaining to adding new Header Template Parts in WordPress 6.2.2, using multiple FSE themes.

The goal: To have (at least) three custom Page templates, each with a different Nav block in its header. The current site has a working header, containing a Nav block with "menu 1" selected from the Classic menu list, in the Front Page, Page (and other) Templates - so it's necessary to add two more Template Parts for Headers, and two new Custom Page Templates, using each new Header.


  • Add second Header Template Part, with a second menu selected from existing Classic menus.
  • Add third Header Template Part, with a third menu selected from existing Classic menus.
  • Add Custom Page Template 2, using Header Template Part 2, including Nav 2.
  • Add Custom Page Template 3, using Header Template Part 3, including Nav 3.

- Note that both new page Templates and Header Template Parts show the correct Nav menu in the editor.

  • Assign one or more pages to Custom Page Template 2
  • Assign one or more pages to Custom Page Template 3
  • BUG: All pages assigned to BOTH Custom Page Templates 2 and 3 will show only Nav menu 3.

In other words, creating the third Header Template Part seems to to overwrite the Nav menu selected in the second Header Template Part.


For each of the two new Header Template Parts (2 and 3)

  • Modify the menu of each Header Template Part in some way, such as:
    • Add an item to the menu at the end (anything - just an empty item is fine).
    • Save the Header Template Part, and test it. You will see the correct menu with the new item.
    • Return to the Header Template Part, remove the extraneous item from the menu, and save it again.
  • After doing this for both of Header Template Parts 2 and 3, they should then function correctly throughout the site.

Change History (0)

Note: See TracTickets for help on using tickets.