limiting subpages.
-
Hi,
Immediatly after my Loop, in page.php, I am using the get_page() function to get the subpages of a current page. The code is as follows.
<?php $pages = get_pages('child_of='.$post->ID.'&sort_column=post_date&sort_order=desc&parent='.$post->ID.'&heirarchical=1'); $count = 0; $more = 1; foreach($pages as $page) { $content = $page->post_content; if(!$content) continue; $count++; $content = apply_filters('the_content', $content); ?> <a href="<?php echo get_page_link($page->ID) ?>"><h1 class="title"> <?php echo $page->post_title ?> </h1></a> <?php echo $content ?> <?php } ?>
The problem I am having is that all the descendents of the current page are displayed, not just the immediate children.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘limiting subpages.’ is closed to new replies.