[wp-trac] [WordPress Trac] #11026: wp_list_pages include and depth argument conflict

WordPress Trac wp-trac at lists.automattic.com
Sat Oct 24 19:58:19 UTC 2009

#11026: wp_list_pages include and depth argument conflict
 Reporter:  pnts          |       Owner:  pnts         
     Type:  defect (bug)  |      Status:  new          
 Priority:  normal        |   Milestone:  Unassigned   
Component:  General       |     Version:               
 Severity:  normal        |    Keywords:  wp_list_pages
 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

 <?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:

 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.

Ticket URL: <http://core.trac.wordpress.org/ticket/11026>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list