1

I'm trying to figure out the best way to solve this 'problem'

I have 4 Custom Post Types:

  1. Players
  2. Teams
  3. Matches
  4. Seasons

And i want to connect them to each other somehow so that i can query the results in the frontend.

This is how i want them to be connected:

  • Each Season has many Teams
  • Each Team has many Players
  • Each Match has many Teams & Players

My first attempt was to connect these 4 types with the Relationship Field (Advanced Custom Field).

For example, in a Season's edit page there is:

Repeater Field -> Sub Field (relationship), Sub Field (Points), Sub Field (Games Played)

With the above method, I came across many problems while querying in the front end.

What would be the best method to achieve the desired results?

user2093301
  • 367
  • 1
  • 6
  • 17

1 Answers1

0

As per me, just prepare a new taxonomy for all these custom post types. This should be a common taxonomy is for all the four types of custom post types. Now you can relate the posts by categories of that taxonomy...Try it once

WpTricks24
  • 815
  • 1
  • 7
  • 26
  • Do you mean i should pick one of the 4 cpt and make it a taxonomy or create a new taxonomy? And how can i link them after that? For example, i want the single-teams.php should pull all the players in that team... – user2093301 Sep 15 '14 at 14:59