3

My website needs to have two custom post types and each of these has two custom taxonomies with several terms each. These terms also have to be hierarchical.

My problem is, that I don't know how to set up a page, that displays all the first level taxonomy-terms of a given CPT. This page should work like a menu. If the user clicks on a term that also has child terms, a new page should be loaded, which displays them.

After having selected the term, an archive page should be loaded which display all the articles that are tagged with the selected taxononomy-term.

Furthermore the URL should include the term-slug if that's possible...

enter image description here

If being on the "Proof for cations"-page, the url should be: example.com/practical-courses/qualitative-analysis/proof-for-cations/

Is this possible with a plugin? Or do I have to program it myself? If so, would you be so kind to help me a little bit on how to set this up? Thank you very much! :)

Page wireframes

These are wireframes of the pages, so you better understand what I'm trying to do.

Step 1

First begin on the Home screen: enter image description here URL: example.com/

Step 2

From here, the user can click on Theory or -as in this example- on Practical Courses in the menu bar. He should then see a page that displays all the 1st level taxonomy terms of the selected posttype. enter image description here URL: example.com/practical-courses/

Each term should also have a thumbnail, so that they better represent what they are.

Step 3

The user will now choose to which practical course he wants to see more information. After selecting one, he should get a page, which displays all the child terms of the selected term: enter image description here URL: example.com/practical-courses/qualitative-analysis/

Step 4

The user can now chose one of the displayed sub-terms and is then redirected to an archive page, which displays all the posts of the selected post type which have both terms added to them. So in our case he will see a listing with all the proof reactions for anions. enter image description here URL: example.com/practical-courses/qualitative-analysis/proof-for-anions/

Step 5

After chosing one, he is finally redirected to the single post of this proof reaction: enter image description here URL: example.com/practical-courses/qualitative-analysis/proof-for-anions/sulfate/

PS

Please note, that there is not always a second level of therms, so Step 3 mab be pointless in some cases and therefore should only be displayed, if the selected term has child terms. If it hasn't, the archive page should be displayed.

3
  • A suggestion for clarifying your question a bit- a taxonomy is a classification set, which contains individual terms. When you say taxonomies it's not clear if you mean multiple groups of terms, or you actually mean multiple terms within a single taxonomy.
    – Milo
    Commented Jan 14, 2017 at 1:52
  • @Milo I did have the plan to make one Taxonomy for each CPT and set up different terms inside these CT's. But, if anyone tells me a better plan, I'll gladly change this! I'm mot that experienced, so this may not be the best option. For clarity I edited my original question to match this idea of mine.
    – Sam
    Commented Jan 14, 2017 at 14:26
  • 1
    Your question is too broad and covers too many topics. If you're looking for an all-in-one solution, then you're probably best off trying to find a theme that does exactly what you want. If you want to program it yourself then you'll need to look into topics like how template files work, how custom rewrite rules work for your custom permalinks, and you'll need to look into the functions you'll need to use, like get_terms() for showing your taxonomy terms and filtering them down register_post_type() for creating your post types. All in all it's a fair bit of work. Commented Jan 19, 2017 at 18:48

1 Answer 1

0
  1. Create the new page template.
  2. Get Terms list manually in that template.
  3. Create the term template for displaying all posts for that term

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.