So I have 2 post types in relationship. Post Type A (parent) and B (child).
I want to list all post from post type A that only have children in Post type B.
Is it possible fix in PHP?
Thank you for contacting us and I'd be happy to assist.
To achieve this you can register a custom shortcode that can get the related child post's ID and returns 1 if it exists and 0 in case there is no child.
Also, add "check-child-exists" in the "Third-party shortcode arguments" section, at WP Admin -> Toolset -> Settings -> Front-end Content.
After that, this shortcode will be available in the conditional block and you can wrap your view's loop content in a condition to only show when the value of this shortcode is equal to '1'.
( ref: https://toolset.com/course-lesson/using-toolset-conditional-block/ )
Example screenshot: hidden link
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.