像这样的方法会奏效:
<!--Child Page Thumbnails Start-->
<?php
$subs = new WP_Query(
array(
\'post_parent\' => $post->ID,
\'post_type\' => \'page\',
\'meta_key\' => \'_thumbnail_id\'
)
);
if( $subs->have_posts() ) :
while( $subs->have_posts() ) :
$subs->the_post();
echo \'<a href="\'.get_permalink().\'" title="\'.get_the_title().\'">\'.get_the_post_thumbnail().\'</a>\'.\'<br/><h2><a href="\'.get_permalink().\'">\'.get_the_title().\'</a></h2>\';
the_content();
endwhile;
endif;
wp_reset_postdata(); ?>
<!--Child Page Thumbnails End-->