• Resolved 0rca

    (@0rca)


    I am trying to list a custom post type “reviews” I created with the plugin “Types” and want to show those posts together with woocommerce products. So I defined the custom post type, set “product” as the parent and then defined a specific product for each review.
    So looking at the rveiew, I can verify the parent product and looking at the product, I can verify the child reviews.
    But it seems I can’t get CCS to list only the relevant child posts.

    I’ve tried
    [loop type=”review” parent=”this”] [field title] [/-loop] [/loop]
    and many other varianst I could think of, but CCS will always ignore the parent-child relationship and list either all or no reviews.

    So I guess “Types” is doing their own thing regarding parent-child relations and I would have to use “Views” or do it in php like described here at the bottom: https://wp-types.com/documentation/user-guides/querying-and-displaying-child-posts/

    Or do you have any other idea?

    https://www.ads-software.com/plugins/custom-content-shortcode/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    Hello,

    The parent parameter only queries for parent posts, not post types. Parent-child relationship between post types is a feature implemented in Types, it’s not a default WordPress feature. I read the documentation page, and fortunately, there does seem to be a workaround by querying the field where Types stores the parent.

    [pass field=id]
      [loop type=review field=_wpcf_belongs_property_id value={FIELD}]
        ...
      [/loop]
    [/pass]
    Thread Starter 0rca

    (@0rca)

    Hi Eliot,
    as always, awesome support, thank you so much.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘List child posts created by "Types"’ is closed to new replies.