Support » Fixing WordPress » Display Only a Subset of a Menu

  • I am working on a site, and I’ve got a top menu with dropdowns. Those are working perfectly. They are using the built-in menu functionality in Appearance>Menus.

    Now I need to build out a left nav that pulls from the same menu (called MainMenu).

    If my full menu is this:

    Top Level 1
    -Second Level 1
    -Second Level 2
    –Third Level 1
    –Third Level 2
    -Second Level 3
    -Second Level 4
    –Third Level 1
    –Third Level 2
    –Third Level 3
    Top Level 2
    -Second Level 1
    -Second Level 2
    Top Level 3

    If I was on any page under Top Level 1, I need to display all pages in Top Level 1, so it should display:

    Top Level 1
    -Second Level 1
    -Second Level 2
    –Third Level 1
    –Third Level 2
    -Second Level 3
    -Second Level 4
    –Third Level 1
    –Third Level 2
    –Third Level 3

    I also need to add something to any Second Level pages that has children. I need to add a SPAN tag after the closing a tag for Second Level 2 and Second level 4. I’m doing this to create an accordion menu in JQUERY. The spans will hold an arrow graphic that, when clicked, reveals the sub-pages underneath. I cannot just CSS the arrow as a background on the pages with children, because those links go to pages.

    Now I know that a Walker Class is most likely needed, but I don’t know a thing about them. I’ve copied and pasted examples before, but I honestly have no idea what a lot of the code is doing, I just know it works.

  • The topic ‘Display Only a Subset of a Menu’ is closed to new replies.