I'm looking to create multiple pages from one custom post type. For example, I have a custom post type called "Students" that collects various pieces of information, such as name, email, phone, bio, and resume for each student.
In addition to creating a template for the Student post type, I need to auto-generate subpages with custom fields from the custom post type. The overall hierarchy would be like:
- Student (top level page,
mysite.com/students-name
)- Bio (i.e.,
mysite.com/students-name/bio
) - Resume (i.e.,
mysite.com/students-name/resume
) - Contact (i.e.,
mysite.com/students-name/contact
)
- Bio (i.e.,
After building these templates, adding a new student should autogenerate any of the above pages.
I've explored two options, neither of which seem great:
- Use subsites - for the minimal amount of information being gathered, subsites seem like major overkill and would not scale well if given hundreds of students (8-9 DB tables per subsite would be thousands of tables)
- Use hierarchical custom post types - this also seems to have scaling issues, as the subpages would need to be duplicated for each student. This makes scaling much harder.
Is there any insight on the best way to go about this?
mysite.com/students-name?bio
).editor
input fields, or meta boxes for the bio, resume, etc. You could then use rewrite rules to make all of the URLs point to the same post, and some template logic to display the content that corresponds to the URL.