Home › Forums › ACF PRO › Bidirectional Relationships and multiple post types › Reply To: Bidirectional Relationships and multiple post types
A bit more info on how to achieve this (using shawnrosspeters example) with Post-2-Post without any code tweaking:
With ACF Post-2-Post, this can be done simply by:
Team CPT
– Create a custom field group for Team CPT
– Set the field group to be visible only on Team CPT
– Create there the field “Related Players” and give it the fieldname “players-teams”
– Filter by Post Type = Player CPT
Player CPT
– Create a custom field group for Player CPT
– Set the field group to be visible only on Player CPT
– Create field “Related Teams”
– Reuse the same fieldname as for Team CPT Related Players (“players-teams”)
– Filter by Post Type = Team CPT
* With this method, you will have a different field label for each of the 2 different custom post types.
* The filtering will only to show results of the other CPT when selecting posts for the relationships.
* By virtue of using the same fieldname “players-teams” in both field group fields, the Post-2-Post plugin works perfectly, ensuring that the bidirectional relationships are established.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.