Need to make a relation of two different custom taxomonies. Example: Sport category with subcategory basketball. Just like that I have team and player taxonomy. I am looking for linking a player with team. Suppose I have 5 players( player a, b,c,d and e and team Z).Now post tagged with a,b,c,d,e also gets listed in team Z post archive.


You can use taxonomy term meta for that. Like you said you have "team" and "player" taxonomy. Now you can add a taxonomy term meta on "player" taxonomy's terms and save the "team" terms(where the "player" belong) ID on that "player" taxonomy term meta. Then get the the player based on that "team" taxonomy term ID taxonomy term meta. By this way you can make the relation between "team" and "player".

Here you'll find a class, by that you can add taxonomy terms easily. And do some google to get the way to filter taxonomy terms based on term meta.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.