Post type hierarchy

I am looking to create two custom post types, one of which is a child of the other. Let’s call them Authors and Books for simplicity.

Authors should be a top level URL and the landing page for them should show a list of all their authored books. So you’d have something like:

http://mysite.com/Shakespeare/
http://mysite.com/Shakespeare/Macbeth
http://mysite.com/Shakespeare/Othello

How do I create something like this in WordPress? I am fine if it requires custom coding, just not sure how to express the relationship of post types to WordPress.

2 Answers
2

To me the most logical would be to have a “Book” custom post type, and then all the attributes of the books (Author, Collection, Genre, etc.) would be custom taxonomies.

Then for your URLs you could use some custom URL rewrite method to get what you want.

Leave a Comment