Custom Post Type with Nested Taxonomy and Template Files
I have a custom Post Type of "Portfolio" with a rewrite slug of
portfolio. So the URL on the frontend is:
I have a custom Taxonomy of "Categories" with a rewrite slug of
portfolio/category. So the URL on the frontend is:
When I visit
domain.com/portfolio/ the Post Type template displays just fine.
When I visit
domain.com/portfolio/category/<term-slug>/ the Taxonomy term template displays just fine.
However, when I visit:
domain.com/portfolio/category/ the Taxonomy template doesn't work. I get a 404 error.
I even tested on core Post Type:
post and core Taxonomy:
category, with the posts page set to
domain.com/blog/Displays posts just fine, served from
domain.com/blog/category/<term-slug>/Displays just fine, served from
domain.com/blog/category/Displays 404 error.
An alternative route I've been taking in the past is to create a "page" for those 404 errors. So for example, I have
/blog/ already creates as a "page". Then I would create
/blog/category/ as another page, so that I wouldn't get a 404 error when the user navigated to:
Is this expected behavior? Is there a work around to not have to create pages for those "Taxonomy Archives"?
How can I have a nested Taxonomy URL and have the
taxonomy.php or even
archive.php template work?