List page title and extract of internal child pages, on homepage (1 post)

  1. amtebbott
    Posted 4 years ago #

    I'm developing a site with the following basic structure:

    • Home
    • About
    • Services
      • Service 1
      • Service 2
    • Contact

    What I want to do is have a loop in my home page code, that will specifically output the Title and Excerpt of each of the service child pages.

    Currently I have this:

    <?php query_posts('page_id=7'); ?>
    			<?php if (have_posts()) : ?>
    			<div class="service">
    				<?php while (have_posts()) : the_post(); ?>
    				<?php the_post_thumbnail(); ?>
    				<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><h2><?php the_title(); ?></h2></a>
    				<?php the_excerpt(); ?>
    			</div> <!-- service -->
    			<?php endwhile; ?>

    However this only outputs the service page title and excerpt, not the child pages.

    Anyone have an idea how I can only apply this to the service child pages.

    Many Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic