Query Pages From More Than One Parent
-
I’m trying to query pages from more than one parent page. This is the code I’m currently using which doesn’t work.
<?php $my_query = new WP_Query ('static=true&post_parent=7,8,9&post_status=publish&order=DESC'); ?> <?php if ($my_query->have_posts()) : ?> <?php $count = 0; ?> <?php while ($my_query->have_posts()) : $my_query->the_post(); ?> <?php $count++; ?> <div id="latest">Latest</div> <div><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></div> <?php the_excerpt(); ?> <?php if( $count <= 1 ) break; ?> <?php endwhile; endif; ?>
Any ideas? Thanks.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Query Pages From More Than One Parent’ is closed to new replies.