How can I make the slug of the taxonomy also the slug of the custom post

I have a custom post type and I need to change the slug to match the category. The same as if in the permalink of the blog posts I associated the category with %category%, but in the custom post with its custom taxonomy.

Example:

Current custom post slug: aaa.com/product/product1/ (/product/%postname%/)

The slug I want: aaa.com/category1/product1/ (/%custom_taxonomy%/%postname%/)

If I rewrite that in the custom post (instead of “product” make it “%custom_taxonomy%”) it actually works and give the products the url that I want, but then all of them return 404 error.

At this point I don’t know if it is possible what I want to do, the easiest way is create a custom post type for each taxonomy I created so I can customize every slug as I want but that’s a lot of work I wan’t to know is there a way to make the url like that slug with the category only.

Thank you very much.

Read more here:: How can I make the slug of the taxonomy also the slug of the custom post

Leave a Reply

Your email address will not be published. Required fields are marked *