wp_list_pages works but adding child pages doesn't
-
I”m using this in the loop of a page template
<article class="eight columns"> <?php the_content(); ?> </article> <aside> <?php wp_list_pages('title_li='); ?> </aside>
as expected, this lists all pages and subpages in the site.
this does not work and nothing is shown:<?php if($post->post_parent) $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); else $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0"); if ($children) { ?> <ul><?php echo $children; ?></ul> <?php } ?>
nor does similar code used to modify wp_list_pages to get only the parent and siblings of the current page.
Am I missing something very simple here?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘wp_list_pages works but adding child pages doesn't’ is closed to new replies.