i’m trying to get this code to work but it seems that the post__in condition is not being taken into account by the query:
$currentPostID = get_the_ID();
$parentPostID = wp_get_post_parent_id($currentPostID);
if ($parentPostID) {
$args = array(
'post_type' => 'post',
'post_parent' => $parentPostID,
'posts_per_page' => -1,
'post__not_in' => array($currentPostID),
'post__in' => $parentPostID,
);
$query = new WP_Query($args);
Is there a way to make it work?
I saw that it can be done by merging two queries but I’m looking for a way to do it in a single query to make them as fast as possible
2
Answers
It expects an array of post IDs, but you are passing a single post ID. Try this:
default sign Sprinklr Quality Assurance
image http://s.spr.ly/6-19BH0okB___prod0-media-proxy.spri.png