• Resolved triffid

    (@triffid)


    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)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘get_posts with post_parent returns empty array’ is closed to new replies.