Forums

Having trouble with a submenu for Pages (8 posts)

  1. nickallain
    Member
    Posted 1 year ago #

    I'm having issues getting a submenu for my pages to work correctly. Here's my page structure:
    Top Level Page 1
    - Sub Page
    - Sub Page
    - Bottom Level Page
    - Bottom Level Page
    - Sub Page
    - Sub Page
    - Bottom Level Page
    - Bottom Level Page
    - Bottom Level Page
    Top Level Page 2
    - Sub Page
    - Sub Page
    - Bottom Level Page
    - Bottom Level Page
    - Sub Page
    - Sub Page
    - Bottom Level Page
    - Bottom Level Page
    - Bottom Level Page
    Top Level Page 3
    - Sub Page
    - Sub Page
    - Bottom Level Page
    - Bottom Level Page
    - Sub Page
    - Sub Page
    - Bottom Level Page
    - Bottom Level Page
    - Bottom Level Page

    If the user is on the top level, I want it to display the children (but NOT grandchildren) - including the title page you're on (at the top).

    If the user is on a Sub Page, I want it to display the children - with the parent at the top of the list.

    If the user is on a bottom level page (grandchild), I want it to display it's siblings with it's parent and grandparent at the top.

    So far I've managed to get about 60% of the functionality correct but I get the feeling I'm re-inventing the wheel. Has anyone done something like this in the past?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

  3. nickallain
    Member
    Posted 1 year ago #

    Thanks esmi but that didn't help me much.

    Here's the code that I have been using. The problem is that when I get to a subpage of a child, it displays all the subpages, not just those of the child.

    [Code moderated as per the Forum Rules. Please use the pastebin]

  4. Root
    Member
    Posted 1 year ago #

    Sometimes I wonder if this is an end user support forum; or a high level "hacking out of shape bleeding edge but heck i can be rich" web developer forum. I don't know.

  5. nickallain
    Member
    Posted 1 year ago #

    Root, are you saying that someone makes money doing this stuff?

  6. nickallain
    Member
    Posted 1 year ago #

    Sorry about the double post, but I've finally found a solution that doesn't include hacking together my own crazy page list:

    http://www.webfish.se/wp/plugins/dynamic-subpages

  7. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    @nickallain: Nobody makes any money helping out on this forum. It is completely volunteer based.

    @Root: If you don't have something constructive to add to the topic, please don't add anything.

  8. nickallain
    Member
    Posted 1 year ago #

    @esmi - I was being a little snarky about the "i can be rich" statement. I appreciate the help offered here.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.