Input please on tricky use of Custom Post Type and Term Hierarchies?
-
I need some input about the optimal way to structure my Custom Post Types, Categories and (if needed) Tags.
Thanks so much in advance for reading this. I do understand the ideas of CPT and Categories and have created and used them before, but I am putting myself in circles trying to figure out how to structure this properly.
What I am looking to do is show stats related to sports and ultimately show them at different “hierarchy levels”:
Players
Teams
League
Matchup (2 teams)Player would be a CPT for a single player with their information and would show hierarchy up to the current team they are on as well as the league they play in (league the team is in). I would be able to set the player name, the stats, link them to the team they are on (which ideally links them automatically to a league) as well as upload a picture.
Team seems like it needs to be a CPT because it needs to show specific information for the team but also list all the players that are currently on the team. I would be able to set team name, some stats and basic information, link them to a league and upload a logo picture.
League seems to be a hierarchy of Player and Team and just needs to list all teams and either all or top players in the hierarchy
Matchup needs to be dynamic and just show some of the information from the 2 teams in the matchup and maybe key players from each
Where I am going around in circles is making sure I have explained this right that it seems I need 2 CPTs and a single hierarchy that connects them as well as ???? for the Matchup to make it dynamic.
How can I like a player to a team (a hierarchy) but also have the team as a CPT? Is that a linking or do I create a Team CPT and also a team_category for all the players?
While entering the data I can make sure it makes sense to only put players in teams in the right league, but for matchups, just need to verify the matchup makes sense (I cannot look for a matchup between the Boston Red Socks and LA Lakers – different leagues).
What makes sense to use for the matchup? It is not a CPT because I do not want to create all the various data points, just make it dynamic that if the selection is NBA/bos-okc or something, it just shows Boston Celtics vs OKC Thunder information.
Last – how about URL structure? I wanted to make it logical like <league>/<team> and <league>/<team>/<player> or maybe just <league>/<player> and then something like <league>/matchup/<team1>-<team2> but I am confusing myself. If Player and Team are CPTs, they each need to be start of the URL and I would actually have something like:
player/<league>/<player-slug>
team/<league>/<team-slug>
(or no <league> in those??)
<league> – just to list the league category informationmatchup/<league>/<team1>-<team2>
Thanks so much for any input. I am sure the answers are much shorter than the explanations.
- The topic ‘Input please on tricky use of Custom Post Type and Term Hierarchies?’ is closed to new replies.