• 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 “blog”. It means that its archive page is:

    https://nguongame.com/blog/

    and its post permalinks have the structure:

    nguongame.com/blog/postname

    On another hand I have a custom taxonomy with id “presscat”, and I need it to have the same slug: “blog”. This taxonomy has terms on it, like “tin tuc”, “huong dan” and “danh gia”. Their permalink structure would be:

    nguongame.com/blog/tin-tuc
    nguongame.com/blog/huong-dan
    nguongame.com/blog/danh-gia

    The problem is that if I use the same slug for both cases, WordPress takes the custom posts (with url “nguongame.com/blog/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 ‘Using same slug for custom taxonomy and custom post type’ is closed to new replies.