Title: child pages query ?
Last modified: August 20, 2016

---

# child pages query ?

 *  [nyckidd](https://wordpress.org/support/users/nyckidd/)
 * (@nyckidd)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/child-pages-query/)
 * hey guys am using the below query to pull my child pages
 *     ```
       <?php
       query_posts('post_type=page&post_parent='.$parent);
       ?>
       	<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> 
   
       my content here
   
       <?php endwhile; ?>
   
       				<?php wp_reset_query(); ?>
       ```
   
 * now the problem is when i click on a link of one of the child pages its not showing
   me the scorrect content rather the latest child page content under the parent
   page…how do i tweak the code ?
 * Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/child-pages-query/#post-2259554)
 * Try using [get_posts](http://codex.wordpress.org/Function_Reference/get_posts)
   or [WP_Query](http://codex.wordpress.org/Function_Reference/WP_Query) if this
   is a secondary Loop (which I assume it is).
 *  Thread Starter [nyckidd](https://wordpress.org/support/users/nyckidd/)
 * (@nyckidd)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/child-pages-query/#post-2259634)
 * Thanks esmi….i used the query_posts and it worked like a charm

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘child pages query ?’ is closed to new replies.

## Tags

 * [child page](https://wordpress.org/support/topic-tag/child-page/)
 * [parent page](https://wordpress.org/support/topic-tag/parent-page/)
 * [query](https://wordpress.org/support/topic-tag/query/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [nyckidd](https://wordpress.org/support/users/nyckidd/)
 * Last activity: [14 years, 8 months ago](https://wordpress.org/support/topic/child-pages-query/#post-2259634)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
