wp_list_pages include and depth argument conflict
|Reported by:||pnts||Owned by:||pnts|
When using wp_list_pages with both the depth and include arguments, child pages will not display at depths equal to or greater than 2. If you replace the include with exclude, child pages display as expected.
So, in this example, I have a large number of top-level pages, and I just want to include 4 pages, plus their children, in my global navigation, I'd use:
<?php wp_list_pages('title_li=&depth=2&include=12,26,22,47); ?>
Except that child pages are not rendered in this view. Instead, if I use the same approach but *exclude* every page that shouldn't be displayed, then child pages are rendered:
<?php wp_list_pages('title_li=&depth=2&exclude=1,2,3,17,18,27,43,46,51,55); ?>
I've noticed this with in the WP 2.8 versions, have not tested it for previous releases. This is replicable with plug-ins disabled and using the default theme.
Change History (3)
- Component changed from General to Template
- Keywords needs-patch added; wp_list_pages removed
- Milestone changed from Unassigned to 2.9
- Version set to 2.8.5