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

by Raul Plana   Last Updated August 28, 2019 08:08 AM

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.



Related Questions



Custom Post Type Advanced Slug

Updated January 08, 2019 22:08 PM

custom taxonomy slug after custom post type slug

Updated August 10, 2016 08:03 AM

Replace slug with taxonomy for ustom post type URLs

Updated March 18, 2017 18:08 PM

Taxonomy page returns 404 page not found

Updated September 20, 2018 07:08 AM