This will display sub-pages without grandchildren, will display children only one. depth level 1 only
<?php
$args = array(
‘sort_order’ => ‘ASC’,
‘sort_column’ => ‘post_title’,
‘hierarchical’ => 0,
‘exclude’ => ”,
‘include’ => ”,
‘meta_key’ => ”,
‘meta_value’ => ”,
‘authors’ => ”,
‘child_of’ => $current_page_id,
‘parent’ => $current_page_id,
‘exclude_tree’ => 1,
‘number’ => ”,
‘offset’ => 0,
‘post_type’ => ‘page’,
‘post_status’ => ‘publish’
);
$pages = get_pages($args);
print_r($pages);
?>

child_of and parent

Advertisements