how to display grandchild with wp_query?
-
I would like to display a list of grand child with wp_query.
This is what I have for display child from the parent.
<?php $page_id = $parent_id; $args=array( 'post_parent' => $page_id, 'post_type' => 'page', 'post_status' => 'publish', 'posts_per_page' => 100, 'caller_get_posts'=> 1 ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { while ($my_query->have_posts()) : $my_query->the_post(); ?> <div class="main_post_listing2"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">› <?php the_title(); ?></a> <?php the_time('M d, Y') ?> </div><?php endwhile; } wp_reset_query(); // Restore global post data stomped by the_post(). ?> </div>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘how to display grandchild with wp_query?’ is closed to new replies.