Custom taxonomy and custom post type using same slug
-
Hi!
I need a custom post type and its related custom taxonomy to use the same slug.
I’ve created a custom post type with slug “press”. It means that its archive page is:
myblog.com/press/
and its post permalinks have the structure:
myblog.com/press/postname
On another hand I have a custom taxonomy with id “presscat”, and I need it to have the same slug: “press”. This taxonomy has terms on it, like “news”, “case studies” and “factsheet”. Their permalink structure would be:
myblog.com/press/news
myblog.com/press/case-studies
myblog.com/press/factsheetThe problem is that if I use the same slug for both cases, WordPress takes the custom posts (with url “myblog.com/press/postname”) as if they were terms of the “press” taxonomy (with term “postname”). I tried to fix it with the “template_redirect” hack, but I get a 404 error.
Anyone has fixed this issue?
Thanks!
- The topic ‘Custom taxonomy and custom post type using same slug’ is closed to new replies.