How to add relationships between custom post types?

Let’s say i have a sample post called “avatar” in “movie”, “trailer”, “review” and “details” custom post types.

How can i display in the “movie” custom post type the content + links to “trailer”, “review” and “details” custom post types ?

Related posts

Leave a Reply

4 comments

  1. Ideally, you’d want to cast your vote into adding the infamous post2post relationship, which is still missing:

    http://core.trac.wordpress.org/ticket/14513

    In the meanwhile, the workarounds are three:

    1. Map your posts to specially crafted taxonomies. (slow)
    2. Store relationships in postmeta. (very slow if you ever need to use that in a join statement)
    3. Create your own post2post table.
  2. You can create relationships between custom post types with the plugin Sub Posts, price: $ 19.99. With this plugin you’re done in minutes, from creating the relationships to displaying them in widgets or shortcodes.

  3. Maybe I see this totally wrong, but is it not better to make just 1 custom post type with different fields ?
    Make a custom post type called movies with the fields review, trailer and details.
    It seems rather odd to sort for example details together of different movies. If it’s the actors for example you want to sort them on, make that a separate field. That way, you can find all movies with a particular actor.