Types plugin lets you easily create relationships between different post types and connect them using GUI controls. You can also connect multiple post types and build many-to-many post relationships.
When you ask for help or report issues, make sure to tell us what you have created so far and the structure that you want to achieve.
Viewing 15 topics - 601 through 615 (of 789 total)
Problem: I have 3 post types, "Provider", "Service", and "Hospital". I would like to be able to link all 3 post types in one relationship, so I can show which Services are provided by each Provider, at each Hospital location. How can I link one intermediary post type to all three post types?
Solution: It's not possible to create a relationship between three post types like this. Instead, the best approach is to use a custom checkboxes group field on the intermediary post type between two of the post types. For example, link Providers and Hospitals in an M2M relationship with an intermediary post type, and add a custom checkboxes group field to the intermediary post. Add one checkbox for each Service post, where the value equals the Service post ID. Then you can assign specific services to each Provider, in each Hospital.
Problem:
Client has a many-to-many relationship and is using the toolset_get_related_posts API function to get related posts. It works in one direction (get A posts related to a B post) but not the other (get B posts related to an A post).
Solution:
The arguments were wrongly supplied to toolset_get_related_posts.
In a one-to-many relationship the one is the 'parent' and the many are the 'children'.
In a many-to-many relationship that same convention doesn't really make sense, but is used anyway.
So the post type on the left is the 'parent' and the post type on the right is the 'child', even though they are more like siblings.
You need to specify the 'parent' and 'child' correctly in the function arguments.
Here is a generic example to retrieve related posts, using the parent-child convention even for a M2M relationship: