The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

How? Pages in page order excluding sub-pages? (3 posts)

  1. charlene2021
    Posted 9 years ago #

    For my list of pages I don't want sub-pages to show up while listing the parent pages in page order. I read http://codex.wordpress.org/Template_Tags/wp_list_pages and I am still unsure of how to do what I want

  2. Andrew Ozz
    WordPress Dev
    Posted 9 years ago #

    "depth (integer)
    This parameter controls how many levels in the hierarchy of pages are to be included in the list generated by wp_list_pages. The default value is 0 (display all pages, including all sub-pages); depth=-1 shows no sub-pages; depth=1 only shows the top level of Pages; a value greater than 1 includes the sub-pages up to the corresponding level in the pages hierarchy."

    So wp_list_pages('depth=-1');?

  3. charlene2021
    Posted 9 years ago #

    works, thanks very much!

Topic Closed

This topic has been closed to new replies.

About this Topic