Creating custom page template

Assuming that you’re on a page template or a custom page template, the first thing you want to do is grab the current page ID, then use that ID to grab the children. Once you have the children, display the content for those children.

Try using get_children(); You can also try get_page_children but for my example, I’m using get_children:

<?php
    //assuming you're on a page template in the loop
    $this_page_id = get_the_ID(); //get this page ID 

    $args = array(
        'post_parent' => $this_page_id, //parent's ID
        'post_type'   => 'page', //just want pages
        'post_status' => 'publish' //only pages that are published
    );

    $children_array = get_children( $args ); //get children pages

    foreach( $children_array as $child_page ){
        //for each child page
        $child_id = $child_page->ID; //get the child ID
        echo get_the_title( $child_id ); //get the child title
        echo get_post_meta( $child_id, 'custom-field-name', true ); //get the child custom field
        echo get_the_content( $child_id ); //get the child content
    }

?>

Replace the “custom-field-name” with your custom field names when you use get_post_meta. Wp_list_pages is more suitable if you wanted to have a menu of your pages versus outputting information from the pages – similar to the way wp_list_categories works for categories. Hope that helps!