WP List Pages: Can’t list subpages
-
I’m trying to list subpages and sub-subpages in sidebar, but for some reason wp-list-pages displays nothing.
This is the code:
$subpage_id = 212; // id number of a subpage, that has sub-subpages $subnavi = wp_list_pages('title_li=&child_of='.$subpage_id.'&echo=0'); if ($subnavi) { ?> <ul> <li class="pagenav"><h2><a href="<?php echo get_permalink($subpage_id); ?>"><?php echo get_the_title($subpage_id); ?></a></h2> <ul> <?php echo $subnavi; ?> </ul> <li> </ul> <?php } ?> <?php endwhile; ?>
Above code works fine when querying top pages, but won’t list anything when querying with sub-pages, that have sub-subpages.
Is this a bug or feature? If it’s more of a feature how can I achieve the same result otherwise?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘WP List Pages: Can’t list subpages’ is closed to new replies.