I've created two custom post types with some custom hierarchical taxonomies. In the navigation a link to the custom post type is displayed. When clicking on it, the user is forwarded to a page that displays the highest level hierarchical terms. He is now free to choose one and is then forwarded to a second page that shows the child terms of the taxonomy he clicked on. He can now choose one of these terms and is then forwarded to an archive page that displays all the articles of these categories.
For a better user experience I think it is essential, to tett the user where he is on the site. And therefore I want to implement a breadcrumb. My breadcrumb works so far, but I have no idea how to show the correct path within posts.
Lets say there is a post named
Post 1 inside the custom post type
My Posts that is categorized with the terms
How can I code the breadcrumb out so that it says:
Home / My Posts / Parent / Child / Post1
This should all work automatically. If a post has the term
Child2 insted of
Child the breadcrumb should adapt. And if there are no child terms but only a parent term, it souldn't display a blank child term.
I hope you understand what I want to get.
Thank you very much in advance!