0

I am attempting to use the main site menu across a bunch of sub-sites in a WordPress multi-site configuration. The sub-sites use the main site's navigation. However, I want to omit one tree of links in the menu and replace them with a defined menu in the sub-site's available menus.

I have no problem getting the main site menu to show up on all multisite blogs. But I can't wrap my head around the walker_nav_menu class to make it conditionally replace a specific tree of the main menu. Furthermore I can't seem to insert the current sub-site's own menu in-place:

Main Site Menu

  • About Us
  • Our Products
  • National Information (conditional based on main or sub-site)
    • Nation-wide Laws
    • Nation-wide FAQs
  • Contact Us

Sub Site Menu-Insert

  • State Information (Replacement)
    • State Laws
    • State Forms
    • State FAQs

(each sub-site is a different state managed by different people with different state-specific content)

Final State Site Menu Output

  • About Us
  • Our Products
  • State Information (Replacement)
    • State Laws
    • State Forms
    • State FAQs
  • Contact Us

The about, products and contact pages are all operated and maintained by the nation-wide corporate HQ, and all contact is driven through them as well.

How should I go about achieving the code for this? The entire set of sites under multisite are using the same theme, so placing this in the functions file is fine and/or putting this into the theme template files is fine as well.

  • How do you plan to differentiate between the original submenu and the sub-site submenu? Are wanting to keep the links static or still be able to manage them? You're probably better off creating two menus and conditionally switching them out entirely versus just a subsection. – Howdy_McGee Jun 23 '16 at 14:12
  • I've edited the question and added context. – Mike Kormendy Jun 24 '16 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.