Will get_pages()
work for you? http://codex.wordpress.org/Function_Reference/get_pages
If I’m understanding your question correctly, you would want something like this:
$children_of_page = get_pages(array(
'child_of' => $post->ID,
'parent' => $post->ID //defining both parent and child forces the list to only include direct children.
));
$children_of_first_child = get_pages(array(
'child_of' => $children_of_page[0][ID],
'parent' => $children_of_page[0][ID]
));
If you wanted to output a list directly, you could use wp_list_pages()
, http://codex.wordpress.org/Template_Tags/wp_list_pages, something like:
wp_list_pages(array( //Get first level children of current page and output as list
'child_of' => $post->ID,
'depth' => 1,
'title_li' => ''
));
$children = get_pages(array(
'child_of' => $post->ID,
'parent' => $post->ID
));
wp_list_pages(array( //output the children of the first child
'child_of' => $children[0][ID],
'depth' => 1,
'title_li' => ''
));
Mess with the arguments as needed to get exactly what you want.