I don't know why, but for some reason neither parent
or child_of
are being accepted as arguments in get_posts
that I'm using a foreach
loop.
$sidebarReviews = get_posts(array(
'child_of' => get_ID_by_slug('testimonial-reviews'),
'orderby' => 'rand',
'posts_per_page' => '6',
'post_type' => 'page'
));
Note: the get_ID_by_slug
is a custom function I have just to translate slugs into page IDs. This is working correctly.
However, when my foreach runs, it seems to pick up every page that's in my Wordpress database.
What's happening?