Display Parent Title and Child Page Content
-
Hello
I’m trying to build a loop that displays the Parent title and then the title and content of any child pages. I’ve got as far as displaying the parent page titles, but I’m not stuck as to how to pull in the child title and content and where to place the code.
Any help very much appreciated, thanks.
<?php $parent_pages = get_pages( array( 'parent' => 0, 'post_type' => 'archive' ) ); foreach( $parent_pages as $parent_pages) { ?> <h2><?php echo $parent_pages->post_title; ?></h2> <?php { ?> <?php } ?> <?php } ?>
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Display Parent Title and Child Page Content’ is closed to new replies.