Problem with displaying Child Posts on Parent page
-
I’m trying to display the child posts on a single CPT page and the output is very strange.
I’m using the following code at the end of the post loop…
<?php $child_posts = types_child_posts('puppies'); foreach ($child_posts as $child_post) { echo $child_post->post_title; echo $child_post->fields['color']; } ?>
It works to display the post_title perfectly fine but it won’t display the ‘color‘ field value that I defined for the child posts. Instead it displays ‘Array‘ and I’m not sure why it’s doing this….any suggestions?
Also, is there a way to display the child posts with html like we can for the Types Fields (aka ‘output’ => ‘html’)?
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Problem with displaying Child Posts on Parent page’ is closed to new replies.