[wp-hackers] Advice regarding Custom Post Types and Taxonomies

Ben Lobaugh lists at lobaugh.net
Thu Aug 9 21:47:06 UTC 2012


Good idea Otto. That taxonomy list will get potentially huge, as all the 
teams will need to be re-added for each year. It may be easier to have 
the team CPT and use a custom field in the team member's profile to 
relate them to the team per year. Then the player can do all that work 
themself instead of the admin having to come in and make new terms each 
year. On login for the next year the player chooses their team for that 
year and boom, done. Or the coach can go into a team page that archives 
the list of players each year and create a new roster.


On 8/9/12 2:30 PM, Otto wrote:
> On Thu, Aug 9, 2012 at 12:18 PM, Mike Walsh <mpwalsh8 at gmail.com> wrote:
>> I am working on a new site for my daughter's soccer team and have decided
>> to use it as an opportunity to learn more about Custom Post Types and
>> Taxonomies.  I have the basics working - I have defined a post type for
>> players and another post type for teams and each have a number of custom
>> fields based on what the team wants to track for each player and at the
>> team level.  I have also defined a taxonomy for player positions so the
>> players can be looked at by position.  I am struggling with how to define a
>> roster for a team and connect the player CPTs to the team and/or roster.
>>   Should the roster be a taxonomy or should the team CPT be hierarchical and
>> each roster is a child of the parent team?
> I think the real question is why would a "team" be a post type? A team
> is essentially a group of players, wouldn't it make more sense as a
> taxonomy?
>
> If you need to define a post type for the team in order to have stuff
> about that team in the posts-table (totally understandable), then I'd
> associate the team-post to the team-taxonomy in an implicit manner,
> perhaps by sharing the postname and the term-slug. Essentially, the
> players and the team would both have the same terms in the
> team-taxonomy.
>
> -Otto
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list