How to link specific posts from one post type to another

Hi, I'm discovering CustomPress right now and i have an issue i would like to discuss.
I first created a custom post type named "Movies".
This includes all the general info (actors, release date etc).
But i also want to create another post type called "Videos" with trailers and interviews.
On the "videos" post type i want to be able to link every video i put to the movie post that is related to the videos.
Example :

- The lord of the rings
- Teaser "Bilbo Baggins"
- Theatrical Trailer
- Peter jackson interview

I tried enabling the "hierarchical" option but it seems it can only give hierarchy capabilities within one post type.

Maybe i am just following a wrong direction and the structure should be completely different.
I looked over it and still haven't found any convincing answer.
Please help a poor newbie :slight_smile:

  • Patrick

    Hi there @Didier

    Welcome to the forums, glad to have you aboard!

    You could create a custom field assigned to the Videos post-type. Then simply enter the URL to the related Movie post.

    Or you could create a non-hierarchical taxonomy (like a post tag) and assign it to both the Movies and Videos post-types. Then when you create a Video post for any specific Movie, give each the same specific tag.

    Clicking that tag in either one of them will bring up the archive results showing only stuff related to that specific Movie/Video combination.

  • Didier

    Hi @Michael,

    I will have 2 post types called "Movies" and "Videos". When i will create a video post i want to be able to select which Movie post it relates to. For example if i create a "Peter Jackson interview" video post i want to relate it to the "Lord of the rings" movie post, this the simplest way possible.

    This in order to display all videos related to one movie when looking at the movie post.

    I already had in mind @Patrick 's trick about creating a shared taxonomy, but i am not convinced of the user-friendliness of this method, as the site will be filled by its users and not the webmaster :slight_smile:

    Best would be to have a select box (inside the videos post type meta box) allowing to choose the movie from a list, but i'm opened to any suggestion :slight_smile:

  • Ash

    Hello @Didier

    I hope you are well today.

    You can't share between two post types, normally. Sharing taxonomies is a good solution, but sometimes it creates some issues.

    The best option would be create a meta box in Videos post type manually, add data from Movies post type and include a checkbox.

    So, that when you will add a video, you will see all movies listed as checkbox in a meta box and you can select one or more movie for that videos.

    Hope it helps :slight_smile: Please feel free to ask more question if you have.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.