Including Pages and their Children with wp_list_pages()
-
I would like to use the wp_list_pages() function to display the menu menu on one of our websites. The menu structure has several pages, some of which have children. If I use the include parameter, I only get the top level pages. Is it even possible to have the children of those pages appear without having to list every single one?
Example structure:
parent (1)
child (4)
child (5)
parent (2)
child (6)
parent (3)
child (7)
child (8)Using wp_list_pages(“include=1,2,3”) gives me:
parent(1)
parent(2)
parent(3)I want all of the ancestors to be displayed as well, instead of having to include every child in the list like this: wp_list_pages(“include=1,2,3,4,5,6,7,8”). Which is tedious and requires maintenance every time a page is added or removed.
- The topic ‘Including Pages and their Children with wp_list_pages()’ is closed to new replies.