Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Sebafaim

    (@sebafaim)

    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>;
    }
    /?>

    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.

    same here… +1

    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.

    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,
    ));

    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' .

    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.