How do I do this with WordPress? Taxonomies?

I was hoping to get some help with how I organise posts in WordPress.

I have 2 Custom Post Types called ‘Places’ and ‘Events’.

In the Admin, I’d like to be able to create a ‘Place’ post and associate multiple ‘Events’ posts to this.
So perhaps inside an ‘Event’ post, I can select a ‘Place’ post from a list to associate that ‘Event’ with that ‘Place’.

Can someone explain how I would achieve this?

Would I have to look at Taxonomies?


Many thanks for any advice.

Solutions Collecting From Web of "How do I do this with WordPress? Taxonomies?"

Three methods:

  1. Don’t use taxonomies at all, just store the ID of the associated posts as post meta
  2. Create a taxonomy, and remove the ability to edit/delete/create terms. Then use automation to catch the hooks for the creation, editing, and deletion of Place posts, and create/edit/delete the associated terms in the taxonomy.
  3. Use the Posts2posts plugin by Scribu, though this would require learning a new API and adding an additional plugin dependency

If your relational mapping is a 1 place can have many events, but one event can only have one place, then a fourth option becomes available:

  • Set the parent post of an event to its place