开发者

Custom Post Type as a Taxonomy

I am stuck in a problem and I need help from you guys. Below is the scenario:

  1. I have two Custom Post Type: Movie and Crew
  2. Crew will behave as a Single Person i.e Tom Cruise, Actor(CrewType)
  3. CrewType : Custom Taxonomy for Crew i.e Director, Actor

The question is I want to attach Crew(Tom Cruise) to Movie(MI2) so I have the following two views:

  1. When goto Movie Page I have Tom Cruise listed in Cast and Crew
  2. When goto Actor Biography page MI2 l开发者_C百科isted in Filmography.

Thanks i advance....


I worked on a project that had a very similar scenario. You can create an additional custom taxonomy for the Crew post type called CrewMovie. The key is to have the slug for the terms in the CrewMovie taxonomy match the slug from the movie post type.

To list the crew when you are are on the movie page, you can do a custom query for post type = Crew & taxonomy = CrewMovie & term = movie-slug.

To list the movies When you are on crew page, you just list all the terms from the CrewMovie taxonomy.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜