Hello. Thank you for contacting the Toolset support.
Well - its not possible to pass multiple post IDs to related_to argument as its not supported. You need to pass the single post ID for which you want to retrieve the child posts.
Hi, i prefer to use WP_Query.
However, the function "toolset_get_related_posts()" can accept multiple id's?
I need to retrieve posts which have different parents.
In the previous releases of types, when the relationships were stored as meta keys, i easily achieve this.
I need to retrieve posts which have different parents.
In the previous releases of types, when the relationships were stored as meta keys, i easily achieve this.
=> May be you can loop through your parent IDs.
For example:
$parent_ids = array(101, 102);
foreach($parent_ids as $k=>$v):
// add your code here where $v contains the parent ID each time the loop iterates
endforeach;
I have custom post type "brands".
I have custom post type "models" which is "brands" child.
I have custom post type "machines" which is "models" child but no have a direct relation to "brands".
In "single-brands.php" i need to show all models related to parent brand and all machines related to models that are children of the brand.
In previous releases of types(before version 3) this was quite easy.
well - there is a limitation that WP_Query cant support such method for now.
But after consulting our Dev - this is the one of the way you can pass multiple parents using post-relationship API function toolset_get_related_posts() :