Title: get_posts with post_parent returns empty array
Last modified: August 19, 2016

---

# get_posts with post_parent returns empty array

 *  Resolved [triffid](https://wordpress.org/support/users/triffid/)
 * (@triffid)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/get_posts-with-post_parent-returns-empty-array/)
 * Hi,
 * I’m having some trouble retrieving child pages of the current page using get_posts.
   `
   get_posts('post_parent='.$post->ID)` returns an empty array. However the following
   DB query returns the relevant pages `'SELECT * FROM '.$wpdb->posts.' WHERE post_parent
   = '.$post->ID;`.
 * I’m using get_posts elsewhere (although with posts and categories) and it is 
   working fine. Can anyone suggest a reason why its not working here? I’d rather
   not have to use a database query.
 * Thanks.

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

 *  Thread Starter [triffid](https://wordpress.org/support/users/triffid/)
 * (@triffid)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/get_posts-with-post_parent-returns-empty-array/#post-777460)
 * Nevermind, I needed to set `post_type` to `page` as it defaults to `post` even
   if `post_parent` is set.
 *  [ivovic](https://wordpress.org/support/users/ivovic/)
 * (@ivovic)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/get_posts-with-post_parent-returns-empty-array/#post-777462)
 * record time, most people take at least an hour to solve their own problem 😉

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

The topic ‘get_posts with post_parent returns empty array’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [ivovic](https://wordpress.org/support/users/ivovic/)
 * Last activity: [17 years, 11 months ago](https://wordpress.org/support/topic/get_posts-with-post_parent-returns-empty-array/#post-777462)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
