- This topic has 1 reply, 2 voices, and was last updated 1 year, 9 months ago by .
Is it possible to use get_posts() to retrieve relationships instead of WP_Query()? Does the relationship argument need to be modified in some way?
I’m running into an issue where either WP_Query() or wp_reset_postdata() is causing problems with other functionality. So I tried switching WP_Query() to get_posts() using the same arguments, but I get an empty array when I do that.
$args = array( 'relationship' => array( 'id' => 'design_to_product', 'to' => get_the_ID(), ), 'nopaging' => true ); // Query $related_designs = get_posts($args); print_r($related_designs);
- You must be logged in to reply to this topic.