Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Main loop
- if ( have_posts() ) while ( have_posts() ) : the_post();
- // Parent (current) page loop
- endwhile;
- // Child pages loop
- $childargs = array(
- 'post_parent' => $post->ID,
- 'post_type' => 'page',
- 'posts_per_page' => '-1',
- 'orderby' => 'menu_order',
- 'order' => 'ASC'
- );
- $child = new WP_Query($customargs);
- if ($child->have_posts()) : while ($child->have_posts()) : $child->the_post();
- /// Loop through child pages of current page
- endwhile; endif;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement