[wp-trac] [WordPress Trac] #58538: Wrong menu is shown after adding new Header Template parts

WordPress Trac noreply at wordpress.org
Wed Jun 14 18:51:11 UTC 2023


#58538: Wrong menu is shown after adding new Header Template parts
--------------------------+-----------------------------
 Reporter:  littleen      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Menus         |    Version:  6.2.2
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 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.

 Steps:
 - 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.
 **

 THE WORKAROUND:

 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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58538>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list