How to have a hierarchy of custom post types and use two of them in the permalink?
General Setup
I’m working on a setup to create a documentary / wiki site for a company. The site should have three different levels of hierarchy and one type of content at the lower end:
- level 1: ‘area’ (high level structure, e.g. ‘internal stuff’ or ‘external projects’)
- level 2: ‘topic’ (main structure, e.g. ‘controlling’ or ‘project xyz’)
- level 3: ‘section’ (groups the content, for a project this could be ‘project management’)
- level 4: ‘content’ (custom post type that holds the content, basically like
pages)
Issue 1
ideally I have a custom post type for all four level. but is this even possible? can I have a custom post type under another custom post type? I didn’t find anything about this…
Permalinks
so the permalinks should be like this:
mysite.com/area/external-projects
simply lists all topics in this area, so area is kind of a category for topic
mysite.com/topic/project-xyz
lists all the sections and the content entries
link to section is not needed
the link to content is tricky and the point where I need help:
mysite.com/topic/my-topic/content/this-is-my-content
Issue 2
so, the permalinks for the content should include the topic and the content. is this even possible if the section (the hierarchy between them) is not in the permalink?
Leave an answer