Looking for opinions on best-practices connecting 2 Custom Post Types together, in a one-to-many or many-to-many situation.
For example (1-to-many), creating an Author CPT and Book CPT (each with their own fields and data, but assigning an Author to a Book.
For example (many-to-many), creating an Actor CPT and Movie CPT (each with their own fields and data), and assigning multiple Actors to multiple Movies.
I’d like for them to function similarly to taxonomies, in that the URL structuring would look similar to:
/author/Stephen-King/ (Stephen King’s profile)
/author/Stephen-King/books/ (List of SK books)
/actors/Leonardo-di-Caprio/ (Leo’s profile)
/movies/Titanic/ (Titanic’s synopsis, screenshots, etc…)
/movies/Titanic/actors/ (list of Titanic’s cast)
For both scenarios, it would be preferable to keep both CPTs under the same “Books” or “Movies” section in the Admin area, but this isn’t strictly required.
What do you think? Anyone done something similar? I’m not actually building a book or movie website, but it seemed like an easy example of the type of connections I need to make.
- The topic ‘Connected Custom Post Types’ is closed to new replies.