下面是我当前显示当前post\\u父级的所有“子”页面的代码(了解如何显示自定义父级页面也会很有帮助…)
<?php
$args = array(
\'post_parent\' => $post->ID,
\'post_type\' => \'page\',
\'orderby\' => \'menu_order\',
\'order\'=>\'ASC\',
);
$my_query = new WP_Query($args);
if($my_query->have_posts()) :
while($my_query->have_posts()) :
$my_query->the_post();
// your stuff goes in this bit.
if ( has_post_thumbnail() ) :
$imgdata = wp_get_attachment_image_src( get_post_thumbnail_id(), \'large\' );
$imgwidth = $imgdata[1]; // thumbnail\'s width
$imgheight = $imgdata[2]; // thumbnail\'s height
?>
<div class="child element isotope-item" style="width:<?php echo $imgwidth;?>;height:<?php echo $imgheight;?>;">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
<?php echo the_post_thumbnail(large); ?>
<span class="child_title"><?php echo the_title_attribute();?></span>
</a>
</div>
<?php
endif;
// end your stuff.
endwhile;
else :
// Do the no posts found message
endif;
?>
</div>