Insert category of taxonomy between custom post type and post
-
Hello everybody
I’m implementing a testing project and from 2 days I’m fighting with the permalink. I want to share with you my problem:
I created a custom post type products;
I created a custom taxonomy brand associated to products;
into taxonomy I created 2 categories: nike and adidas;
I finally created a product t-shirt and I categorized it as nike.What I would obtain is a permalink like this:
www.example.com/products/nike/t-shirt
Instead this it happens:
I can visit the page of category nike
/products/nike/
where there are links to t-shirt posts.On the t-shirt page the permalink changes and becomes
/products/t-shirt/
In practice, I lose the reference to category /nike/
what I get:
/products/t-shirt/
what I would like:/products/nike/t-shirt/
I fix this with a static solution:
into the custom post type I added
'rewrite' => array('slug' => 'products/nike','with_front' => false),
can I replace nike with something filter?
Any idea?
- The topic ‘Insert category of taxonomy between custom post type and post’ is closed to new replies.