How to Loop within a Loop (Display Children and then Grandchildren)
Try something like: <?php if ( have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> <div class=”parent-post”> <?php the_title(‘<h2>’, ‘</h2>’); ?> <?php $children = new WP_Query( array(‘post_type’ => ‘page’, ‘post_parent’ => get_the_ID() )); ?> <?php if ( $children->have_posts() ) : ?> <ul class=”post-children”> <?php while ( $children->have_posts() ) : $children->the_post(); ?> <li><?php … Read more