Hello
I have a parent called [Department] slug `department and a child called [imagedates] slug `imagedate.
Established a relationship one to many, department to many imagedates.
My custom fields are managed by ACF pro so initial plan was to use Toolset Views to display them which worked fine to display just text fields loading non Toolset fields, but it dosent work to display image fields.
So now what im trying to do is display child posts with the code below:
Tried this code which it should work, but nothing shows up
but not luck.
Any advice or insight idea whats wrong with the code would be great. If can still show image fields from ACF with just a View i can go that way also.
Thank you for your code example.
It works but it only shows the count of child posts. For example Parent post is k1 so it shows child posts k1 k1 k1 which are three child posts.
Is there a way to display child post fields inside the loop, custom fields of toolset?
If you have any examples that would be great.
Thank you
foreach ($related_posts as $related_post) {
// add whatever you want
}
You can get the post ID insider above loop, like this:
$post_id = $related_post->ID;
And pass $post_id as parameter to Types function types_render_field(), for example:
types_render_field( "my-field-slug", array("post_id"=>$post_id ) );