Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // use wp_list_pages to display parent and all child pages all generations (a tree with parent)
- $parent = $post->ID;
- $args=array(
- 'child_of' => $parent
- );
- $pages = get_pages($args);
- if ($pages) {
- $pageids = array();
- foreach ($pages as $page) {
- $pageids[]= $page->ID;
- }
- $args=array(
- 'include' => $parent . ',' . implode(",", $pageids)
- );
- wp_list_pages($args);
- }
- ?>
Add Comment
Please, Sign In to add comment