We have a custom content type called Teams. We have another custom content type called Matches. We would like to have two select fields within the Field Group for Matches that will have all the post titles from the Teams content type as the selectable options.
You have helped with something similar for another site I handle that uses Toolset so I know this can be done. But I tried copying over some of the previous code you helped us with and I couldn't get it to work.
If you can help with getting this set up it would be appreciated.
Hello,
In your case, it needs two one-to-many relationships between post types "Teams" and "Matches"
See below sandbox website:
Login URL: hidden link
1) Create two one-to-many relationships between post types "Teams" and "Matches":
hidden link
- Teams A Matches
- Teams B Matches
2) In the single "Match" post:
hidden link
You can connect it with different "Teams" posts
And display them like this:
[wpv-post-link item="@team-a-matches.parent"] VS [wpv-post-link item="@team-b-matches.parent"]
See the result here:
hidden link
In single "Teams" post, you can follow our document to display the related "Match" posts:
https://toolset.com/course-lesson/displaying-related-posts/#displaying-many-related-items
This worked perfectly as well. I like that defining the teams is done through the relationship instead of with a custom field, because the relationship was going to have to be done anyway. This eliminates the need for the extra fields.
Thanks a bunch!!!
My issue is resolved now. Thank you!