3

I have spent days now trying to figure this out, StackOverflow is my last resort. All I want is the following:

http://www.mydomain.com/my-post-stype/my-top-level-category/my-sub-level-category/my-page.html

For posts this is insane easy, just adding /%category%/%postname%.html as a permalink does the trick. However for custom post type this seems insane tough.

I have a registered post_type project. And a taxonomy project_category

Now I like my permalinks to turn out as

/project - Overview of projects in all categories.
/project/CATEGORY - Overview of projects within that category.
/project/CATEGORY/SUBCATEGORY - Overview of projects within that subcategory.
/project/CATEGORY/SUBCATEGORY/postname - The actual post.

Probably wp_rewrite needs to help me out here tho I have no clue how. Can anyone help me out?

1 Answer 1

1

I've just gotten my head around Doing something similar. This is adapted from this tutorial

  1. For your post type registration make sure that query_var, publicly_queryable, and has_archive are set to true and rewrite is set to false.
  2. Next up is the code here.

Edit: sorry, but code hinting is completely not working for me today. Code is in above link

3
  • No prob. If any help is needing understanding anything for future reference, ask away. Sep 19, 2011 at 23:54
  • It did, however, not solve the entire question I am going to repost this going into more details.
    – Mark
    Sep 20, 2011 at 11:04
  • What didn't it solve? Sep 20, 2011 at 13:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.