I am trying to display child posts on a page
Link to a page where the issue can be seen:
hidden link
I expected to see Quick possessions of that home model showing in the section specified
Here is the code being used:
<?php
$child_args = array(
'post_type' => 'quick-possession',
'numberposts' => -1,
'order' => 'ASC',
'toolset_relationships' => array(
'role' => 'child',
'related_to' => get_the_ID(),
'relationship' => array( 'home-model', 'quick-possession' )
)
);
$query = new WP_Query( $child_args );
while($query->have_posts()) : $query->the_post();
$title = get_the_title();
?>
<article class='col s12 m6 l4' >
<h4></h4>
</article>
<?php endwhile; wp_reset_postdata();?>
That is a new, not migrated Post Relationship.
Hence, the right API to use is toolset_get_related_posts():
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_posts
Example:
$books = toolset_get_related_posts(
$writer, // get posts related to this one
array( 'writer', 'book' ), // relationship between the posts
'parent', // get posts where $writer is the parent in given relationship
$posts_per_page, $current_page, // pagination
array( 's' => 'Harry' ), // How was his surname, again…?
'post_object'
);
The code you use is for Legacy Relationships and migrated sites, which I do not see to be the case this Relationship on your site:
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/how-to-migrate-your-site-to-new-post-relationships/
Please let me know if you have any more questions in regard?