0
votes

I have a custom post type like 'articles' and use built-in categories like 'rock, pop, jazz, etc' to categorised this articles. I have a permalink for 'articles' archive also have permalink to and category archive page like jazz archive page.

But also I want to permalink to articles that filter by specified categories. my archive page also handle this conditions but I can't get permalink for this page!

When I type this address to browser 'index.php?post-type=articles&category-name=jazz' this url redirect to /category/jazz/?post-type=articles but I want this is apear in this format /articles/category/jazz

1
You probably have to use the WP_Rewrite class. There should be lots of tutorials on the web. I'd love to give a go at your case but can't right nowkjetilh

1 Answers

0
votes

In order to achieve that you first need to register your category with the custom post type and then you can assign categories and have the desired result. Use register_taxonomy_for_object_type(); in order to assign category taxonomy to your custom post type. You can get an example here : http://codex.wordpress.org/Function_Reference/register_taxonomy_for_object_type