• Resolved blackc2004

    (@blackc2004)


    Is there a way I can use query_posts('page_id=48'); to get the children of the page with that ID?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    No. You can use get_posts to do that though.

    Thread Starter blackc2004

    (@blackc2004)

    Thanks!

    Incase anyone else needs this. Here’s the code I used:

    $args = array(
    	'post_type' => 'page',
    	'numberposts' => 4,
    	'post_status' => 'publish',
    	'post_parent' => 33, // any parent
    	);
    $attachments = get_posts($args);
    //print_r("attachements:" . $attachements);
    if ($attachments) {
    	foreach ($attachments as $post) { ?>
    		<li class="i_read" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a><br/>
    	<?php
    		$the_excerpt = get_post_meta( $post->ID, '1lineblurb', $single = true);
    		if ($the_excerpt != '') { echo($the_excerpt); }// if: filename not blank
    	}
    }
    ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘query_posts to get children of pages’ is closed to new replies.