Простой способ, из примера все будет ясно.
Пример
<?php
$pages = get_pages( [
'sort_order' => 'ASC',
'sort_column' => 'post_title',
'hierarchical' => 1,
'exclude' => '',
'include' => '',
'meta_key' => '',
'meta_value' => '',
'authors' => '',
'child_of' => 0,
'parent' => -1,
'exclude_tree' => '',
'number' => '',
'offset' => 0,
'post_type' => 'page',
'post_status' => 'publish',
] );
foreach( $pages as $post ){
echo '<h2>'.get_the_title().'</h2>';
}
wp_reset_postdata();
?>
Так же приведу пример как вывести список дочерних страниц от определенного родителя.
Пример
$stati_children = new WP_Query(array(
'post_type' => 'page',
'post_parent' => get_the_ID()
)
);
if($stati_children->have_posts()) :
while($stati_children->have_posts()): $stati_children->the_post();
echo '<h2>'.get_the_title().'</h2>';
echo '<p>'.get_the_excerpt().'</p>';
echo '<p><a href="'.get_the_permalink().'">'.Подробнее.'</a></p>';
endwhile;
endif; wp_reset_query();