Hi there,
This question is absolutely not a Types issue and therefore I do not expect Toolset Support to supply an answer, but I figured I'd ask the experts anyway. My question involves creating an artificial URL structure and routing it to the correct custom post.
Here's some background information:
+ I'm building a course catalog for a continuing education department at an art college. The hierarchy of information looks like this: catalog > department > course > section > faculty. All objects are custom post types, except "department" which is a custom taxonomy. I've attached a diagram to illustrate the relationships (pce catalog data relationships.png).
+ Multiple catalogs can be published simultaneously (for example, there will be overlap between when the Spring 2019 catalog is active and Summer 2019 launches).
+ A section is an instance of a course. This reduces data redundancy when the same course runs two or three times in a given catalog (and across multiple catalogs).
+ Right now, the permalink structure of a section looks like this:
hidden link
Note: "section" is the custom post type prefix. "handmade-books-01" is the slug of the section.
+ The user-facing hierarchy that I wish to express looks like this: catalog > section > section number. The permalink structure that I want to use would look like this:
hidden link
...where "spring-2019" is the catalog.
...where "handmade-books" is the slug of the course (NOT the section).
...where "01" is the section number.
+ Based on the desired URL above, I want to do a dynamic lookup of the correct section and display it (and to be clear, not forward users to it, which I could easily do with mod_rewrite—I want users to be able to bookmark clearly articulated URLs).
+ A bonus permalink structure would also let me add the name (slug) of a faculty member onto the end of the web address, like so:
hidden link
hidden link
--
I've done a bit of research into add_rewrite_rule() and add_rewrite_endpoint(), but I'm having difficulty with the implementation. The best guide I've found is at https://make.wordpress.org/plugins/2012/06/07/rewrite-endpoints-api/.
Are you able to offer any guidance?
Thank you!
Saul