WordPress.org

Ready to get started?Download WordPress

Forums

Menu
CMS (6 posts)

  1. Patrick Johanneson
    Member
    Posted 3 years ago #

    I'm trying to use wp_list_pages to generate a navigational structure that looks like this:

    Site Home
            Sibling
            Sibling
                child
                child
                    grandchild 1
                        gg-child
                    grandchild 2
                child
            Sibling
            Sibling
    

    and so far I'm stymied. Any assistance would be hugely appreciated.

  2. zartgesotten
    Member
    Posted 3 years ago #

    Did you use the "depth"-argument?

    <ul>
    <?php wp_list_pages('depth=4'); ?>
    </ul>
  3. Patrick Johanneson
    Member
    Posted 3 years ago #

    I did. "depth" gives back entirely too much.

    Sorry, I might have been less than clear in my original post.

    What I have:

    A site that looks like this:

    Site Home
            Sibling
            Sibling
                child
                    grandchild 1
                        gg-child
                    grandchild 2
                child
                    grandchild 1
                        gg-child
                    grandchild 2
                child
            Sibling
                child
                    grandchild 1
                        gg-child
                    grandchild 2
                child
                    grandchild 1
                        gg-child
                    grandchild 2
                child
            Sibling
            .
            .
            .
            

    What I want:

    When I'm on the page "grandchild 1", I want to see:
    - its immediate children, if any
    - its parent and its parent's siblings
    - the rest of its ancestors, and their siblings

    Like so:

    Site Home
            Sibling
            Sibling
                child
                child
                    grandchild 1
                        gg-child
                    grandchild 2
                child
            Sibling
            Sibling

    laid out according to menu_order.

    Thanks!

  4. zartgesotten
    Member
    Posted 3 years ago #

    You could try the Plugin "Simple Section Navigation" and see if it works for you. Otherwise you would probably have to manually program that.

  5. Patrick Johanneson
    Member
    Posted 3 years ago #

    Thanks for the link. I tried it and... it just gets the current page and its children.

    Back to programming. If I come up with a solution I'll post the code here.

  6. zartgesotten
    Member
    Posted 3 years ago #

    I don't know how you did it but if I try this plugin it gives current page, its siblings and only the current page's children...
    Well... programming ist always a way to learn more... ;-)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic