All of the answers I’ve found so far – here and elsewhere – involve creating a (custom) post – which would be ‘overkill’ because in this instance many of the ‘terms’ would only appear once.
Specific example to explain what I’m trying to accomplish:
Person A may be the composer of Song 1;
Person A may be the lyricist of Song 2;
Person A may be both the composer and lyricist of Song 3;
Person A may have been the presenter of Show 1.
I (think I!) want to have one taxonomy of ‘person’ (i.e. so that Person A is only entered once) with other taxonomies of ‘composer’, ‘lyricist’ and ‘presenter’. Then on the actual post for Song 1, Song 2, Show 1, etc. I have each person:relationship. A search for Person A would then show that (s)he is connected to:
Song 1, as 'composer';
Song 2, as 'lyricist';
Song 3, as 'composer' and as 'lyricist';
Show 1, as 'presenter'.
Alternatively, if I’m asking the impossible and have to relate through a ‘person’ custom post, is there an ‘easy’ (i.e. automatic) way to create it, i.e. when I’m inputting data for a song, show, etc. and just want to enter a name?
Should add that “No … looked for ages (or tried clever ways) but haven’t found a solution” is an acceptable answer. Not the one I was hoping for but at least it might convince me to stop looking / trying!
Using standard WordPress functionalities this is, simply, not possible, unless using complicated and poorly performing tricks.
The method I suggest you is to create your custom table where store relationship.
It should consists of 5 columns:
Now, copying out your example:
and assuming:
To rapresent the relationships in your example we need 5 rows in the table
Knowing a person id you know all his/her talents and to which posts are related. Same way, knowing a post id you know all people related and which is the talent involved in that particular post.
Getting and showing data it’s a cinch: once people, talents, song and shows are wordpress standard entities (posts, terms) you have to do nothing to create url for show them selectively and you can make the better use of template hierarchy as well. Getting custom associations is very easy, few lines of sql and you are done.
Store custom associations is a bit harder: not being part of wordpress core you have to built entirely the UI for the scope. Nothing impossible: you need just a metabox with some rows (or better the ability to dinamically add rows) and for every row two select menus: one for people one for talent.
Note that this method allow link people with every post type and every taxonomy: maybe now you will use only standard post type and ‘talents’ but in the future… I always like design in a flexible manner to avoid refactoring at every change.
Hope it helps.
If you want an out of the box way to do this I’d say use Advance Custom Fields, it has a friendly UI and it’s really simple to use and understand, you can either choose a relationship type or a post object then with some work on your theme you’ll get the relation between post types or taxonomies.
http://www.advancedcustomfields.com/resources/field-types/relationship/
http://www.advancedcustomfields.com/resources/field-types/post-object/
Else I’d go for G. M. answer.
So here is the thing with a structure like this. It goes both ways. Person A can be the composer of poem 1, and singer of song 2, and you can associate them via metas. However, the thing is, Person A him/herself is a composer & singer to begin with. So you might want to do something like this:
Create Person as a CPT, create new Persons and add traits to them like singer or composer. Then create CPT for different types of entertainment, like one for TV shows and one for Poems. And then link Person via a meta field.