How to finish this loop?

I think that the very helpful user gave you a wrong answer. Here a example which I think is better:

 //The ID of the parent page, for example 4. Change to the correct ID.
 //For example, if you are in the page loop, you can use get_the_ID() to get ID of current page
 $parent_id = 4;

 //The terms that the page belongs to.
 $terms = array( 'one_term', 'another_term' );

 $args = array(
      'post_type'   => 'page',
      'post_parent' => $parent_id,
      'tax_query'   => array(
                'taxonomy' => 'top5',
                'field'    => 'name',
                'terms'    =>  $terms

 $query = new WP_Query( $args );

 if ( $query->have_posts() ) {

     //Start the loop
     while ( $query->have_posts() ) {


         //Do whatever you want with the found pages. For example:
         if( has_post_thumbnail() ) {

     //End the loop


  } else {

    //Do something if pages have not been found


NOTE: By default, “pages” doesn’t have taxonomies, so I assume that you have registered the “top5” taxonomy for “pages” post type. Also, you say that you want to get the excerpt of the pages and by default pages has no support for excerpt, so I assume you have added excerpts support for pages.