WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. charlene2021
    Member
    Posted 7 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 7 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
    Member
    Posted 7 years ago #

    works, thanks very much!

Topic Closed

This topic has been closed to new replies.

About this Topic