• Hello everyone,

    I am trying to figure out one thing regarding taxonomies.

    I have custom post type for movies where I need to show Director and Actors.
    At the moment I have two custom taxonomies – actor_taxonomy and director_taxonomy.
    This works fine, I can add Director and add Actors when creating movie page and then show it to visitors.
    The thing is – some actors actualy direct. Result is now I have same names in actor_taxonomy and director_taxonomy. So I would like to merge those two taxonomies in one taxonomy – name_taxonomy.

    My problem is how to properly achieve this? As I need to have possibility to add director and actors at the same time – I basically need two separate boxes that would render same taxonomy but based on some extra criteria (I only need director in Director field but actors in Actors field – source for both would be name_taxonomy).

    I am kind of stucked and I am not sure how to continue.

    Thanks for any help!
    Best,
    Victor

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    That is certainly possible. It’s not a problem having two meta boxes presenting the same names to checkmark. Which name was picked for what role can be managed through other means, term meta perhaps. Converting existing data is a matter of writing a one time script to go through all existing movies and converting the term assignments.

    I question if this is really a good idea though. I don’t see the problem with having the same term names in different taxonomies. If I wanted to query for movies where Eastwood directed, the URL would just be example.com/director/c-eastwood/. Similar for movies he acted in. If there was a single taxonomy for all names, our URL would be more like example.com/names/c-eastwood/?meta=director. Sure, we could come up with some rewrite rules so the former URL works with a single taxonomy. But it adds complexity where, with the two taxonomy scheme, WP pretty much handles it automatically without rewrite rules.

    Just sayin’. It’s your site, set it up how you want.

    FYI you are better off making a People post type in addition to your Movie post type.

    Then you can use something like Advanced Custom Fields to define a post-to-post relationship. When you assign a Person to a Movie or vice-versa, a relationship such as Actor or Director can be assigned to that link.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘One taxonomy for two meta boxes – sharing taxonomy’ is closed to new replies.