Support » Fixing WordPress » Display children of one parent page on home page

  • So I have a loop that is displaying all pages (not posts) on my home page. I want to modify the loop so that it’ll only display the children of a single parent page (the page id number is 116, just for reference). How should I modify the code below to do this?

    <?php query_posts('post_type=page&posts_per_page=-1'); ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    		<a href="<?php the_permalink() ?>"
    		rel="bookmark" 	title="Permanent Link to <?php the_title_attribute(); ?>">
    		<div id="roster-main-profile">  
    			<?php echo get_the_post_thumbnail($page->ID, 'thumbnail'); ?>
    		<div class="roster-main-name"><?php the_title(); ?>
    			</div>	<!-- headlines-title -->
    		<?php  endwhile; endif; ?>

    Also wanted to add that displaying grandchildren is OK, too…

  • The topic ‘Display children of one parent page on home page’ is closed to new replies.