Query a list of child pages for a parent

Description

This code is to be used in page template to query a list of children of the current page.

PHP Source Code

                        
                          <?php

$args = array(
    'post_type'      => 'page',
    'posts_per_page' => -1,
    'post_parent'    => $post->ID,
    'order'          => 'ASC',
    'orderby'        => 'menu_order'
 );


$parent = new WP_Query( $args );

if ( $parent->have_posts() ) : ?>

    <?php while ( $parent->have_posts() ) : $parent->the_post(); ?>
	<!--Children Page details start here-->







	<!--Children Page details End here-->
    <?php endwhile; ?>

<?php endif; wp_reset_postdata(); ?>                        
                        


Post Categories