I have a custom post type with a hierarchical custom taxonomy. The taxonomy has several parent terms and each parent term has several child terms. The posts are assigned to one parent and (mostly) one child.
I want that my archive page example.com/{cpt_slug}
only displays the parent terms. After a first selection, the user will be on the second archive page example.com/{cpt_slug}/{parent_term_sug}
. If the selected term has children, this page should only display those, so that the user can, once again, take a decision on what he wants to see. Otherwise, the posts of this term should be shown.
At the moment there are no plans to have child-child-terms, but if it's possible to have a completely dynamic code which could handle grandchildren and maybe even more, that would be even better.
Have you any idea on how I could achieve this? Many thanks in advance!!
example.com/{cpt_slug}/{parent_term_sug}
urls is probably not going to be easy to implement. Maybe with a plugin like Custom Post Type Permalinks (I haven't tested this).