Title: Child posts doesn&#039;t work
Last modified: August 21, 2016

---

# Child posts doesn't work

 *  Resolved [Sebafaim](https://wordpress.org/support/users/sebafaim/)
 * (@sebafaim)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/child-posts-doesnt-work/)
 * Sorry for my english, it’s not native language.
    I used [this tutorial](http://wp-types.com/fr/documentation-2/guides-de-lutilisateur/affichage-des-champs-de-publications-enfant/)
   with the 1.3 version of Types. It worked perfectly with the 1.3, but with the
   1.4.1 it doesn’t work, the post doesn’t display the content of each child, but
   only the content of the last child’s post on each post.
 * [http://wordpress.org/plugins/types/](http://wordpress.org/plugins/types/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Thread Starter [Sebafaim](https://wordpress.org/support/users/sebafaim/)
 * (@sebafaim)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/child-posts-doesnt-work/#post-4139321)
 * This is the code I use :
 * <?php
    $child_posts = types_child_posts(‘photo’); foreach ($child_posts as $child_post){
   $imgTitle = $child_post->post_title; $imgUrl = $child_post->fields[‘photo-test’];
   $imgDesc = $child_post->fields[‘photo-desc’];
 *  $path_parts = pathinfo($child_post->fields[‘photo-test’]); //just for miniature
   
   $chemintest = $path_parts[‘dirname’]; //just for miniature $filenametest = “/”.
   $path_parts[‘filename’]; //just for miniature $miniaturetest = $chemintest.$filenametest.”-
   40×25.jpg”; //just for miniature echo ‘<;a href=”‘.$imgUrl.'” title=”‘.$imgDesc.'”
   ><img src=”‘.$miniaturetest.'” alt=”‘.$imgTitle.'” height=”25″ width=”40″/>'</;
   a>; } /?>
 *  [Grsmto](https://wordpress.org/support/users/grsmto/)
 * (@grsmto)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/child-posts-doesnt-work/#post-4139381)
 * Same issue here.
 * I spent hours reinstalling my wordpress website, but after few debugs, it definitely
   comes from the plugin last update.
 * It was working great before update.
 *  [Colir](https://wordpress.org/support/users/colir/)
 * (@colir)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/child-posts-doesnt-work/#post-4139460)
 * same here… +1
 *  [jozik](https://wordpress.org/support/users/jozik/)
 * (@jozik)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/child-posts-doesnt-work/#post-4139475)
 * Hi all,
    so call stopped working after update and custom code did not change?
   Can you please paste how you’re using API call and short description where you’re
   using it?
 * Also, is there something specific regarding children post types (post statuses,
   are they publicly queryable…)?
 * We checked possible changes that could provoke it, but could not see anything
   wrong. On our tests everything worked fine. We’ll see how to reproduce this and
   see what needs to be fixed.
 *  [jozik](https://wordpress.org/support/users/jozik/)
 * (@jozik)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/child-posts-doesnt-work/#post-4139481)
 * Hi everybody,
    there is some wrong caching in this API function. It’s fixed for
   next release.
 * Temporary fix is to add these arguments:
 *     ```
       types_child_posts( $child_post_type, array(
           'meta_key' => '_wpcf_belongs_{$parent_post_type}_id',
           'meta_value' => $parent_post_id,
       ));
       ```
   
 *  [Grsmto](https://wordpress.org/support/users/grsmto/)
 * (@grsmto)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/child-posts-doesnt-work/#post-4139484)
 * Temporary fix works, thank you!
 * Don’t know why but I had to use `'_wpcf_belongs_'.$parent_post_type.'_id'` instead
   of `'_wpcf_belongs_{$parent_post_type}_id'` .
 *  [jozik](https://wordpress.org/support/users/jozik/)
 * (@jozik)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/child-posts-doesnt-work/#post-4139485)
 * sorry, I used single quotes instead of double (that’s why it failed).

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Child posts doesn't work’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/types_ced1d3.svg)
 * [Toolset Types - Custom Post Types, Custom Fields and Taxonomies](https://wordpress.org/plugins/types/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/types/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/types/)
 * [Active Topics](https://wordpress.org/support/plugin/types/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/types/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/types/reviews/)

 * 7 replies
 * 4 participants
 * Last reply from: [jozik](https://wordpress.org/support/users/jozik/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/child-posts-doesnt-work/#post-4139485)
 * Status: resolved