Hierarchical Custom Post Types
I would like to have the following taxonomy structure:
site.com/courses/course-name/pathway/pathway-name
The domain is such that any particular course can be completed by taking a number of different pathways - different module structures.
The following URLS would work as such:
site.com/courses
shows a list of courses
site.com/courses/course-name
will follow a template e.g. single-course.php, showing title, content and a list of the pathways associated to this course.
site.com/courses/course-name/pathways/
will follow a template e.g. archive-pathway.php, showing course-name and a list of pathways (not be used so much but will still need to work)
site.com/courses/course-name/pathways/pathway-name
will follow a template, e.g. single-pathway.php, showing the course-name title, the pathway-name title and content for this pathway.
The files here may be incorrect whereby I should be using taxonomy-{}.php or otherwise as appropriate, instead of single-{}.php.
My question: is it possible to set up the above hierarchy within WordPress? If so, please provide some code to register_taxonomy
or register_post_type
as appropriate to help me get started.
I cannot find how to do this elsewhere but am pretty sure this is how courses in the TutsPlus network use WordPress.
Topic hierarchical custom-post-types Wordpress
Category Web