• I’m trying to post my menu on the webpage… but I’m having trouble showing the CHILDREN show up under the PARENT menu items…

    I am using the following…

    <?php wp_list_pages(‘include=2,52,11,41,50,54&sort_column=menu_order&title_li=&child_of=2,52,11,41,50,54’ ); ?>

    I choose …
    include=2,52,11,41,50,54
    … because I only want a few PARENT items to be show. For each of those PARENT items, I want the CHILDREN to appear as a list beneath them. Right now, my list is only printing the PARENT items (and NO children).

    I know the styles work fine, because I can see the menu when I hard code the menu with it’s children.

    I checked the CODEX for wp_list_pages, but I couldn’t figure it out (I came up with the solution above). Can someone help me and show me how to do this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The include parameter is explicit. In other words, it will only display those pages that are listed – even if some of them have children. Under these circumstances, the child_of parameter will be ignored. Perhaps you could look at excluding pages instead?

    Thread Starter jabbamonkey

    (@jabbamonkey)

    I’m concerned about an administrator adding a new page, and it automatically appearing in the main navigation. They may just forget to add the new page to a parent page…

    So, I want to avoid using the exclude in the code (because I would have to edit the code every time they add a page). I also know there is a plugin that lets people EXCLUDE pages from navigation … but I’m trying to make the adminstration dummy-proof. (because they WILL just add pages everywhere).

    Oh well. I guess I will just have to live with the following….

    <?php wp_list_pages(‘sort_column=menu_order&depth=2&title_li=’ ); ?>

    It works, shows the two levels of navigation. I just need to be wary when an admin adds a new page.

    Thread Starter jabbamonkey

    (@jabbamonkey)

    That could solve it. Then I wont have to worry about them adding things to the menu! Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘wp_list_pages – show select parents AND their children’ is closed to new replies.