1

I've found this great plugin Custom Post Type Permalinks by a Japenese developer which is awesome at generating hierarchical permalink structures for Custom Post Types. Only I'm having an issue which I cannot get around and am looking for a solution.

I have a custom post type classes and a taxonomy classes_categories (ex: languages, technology, sciences...)

The links generated by WordPress for the 'classes_categories' look like this:

http://site.com/classes/class_categories/languages/

I would like them to be like this:

http://site.com/classes/languages/

Strangely, both of the URL's work but I would like WordPress to generate them without 'class_categories' in the URL.

I'm looking for a solution which would involve either plugin configuration, my taxonomy declaration parameters or perhaps a workaround with a hook or something (maybe parse the URL when they a being rewritten).

thank you

2 Answers 2

0

I managed to find a way to fix this by toying with my Custom Post Type and Taxonomy registrations.

In register_post_type properties:

'rewrite' => array( 'slug' => 'classes' ),

In register_taxonomy properties:

'rewrite' => array( 'slug' => 'classes', 'with_front'=> false ),

I now have a clean structure where http://site.com/classes/ points to the post type archive template, http://site.com/classes/languages/ points to the taxonomy archive template and http://site.com/classes/languages/french/ points to the post template

0

I am the author of Custom Post Permalinks.

The Permalink like

http://site.com/classes/languages/

is impossible.

Because, /languages/ is unable to determine term_name or post_name.

Sorry. But I want to achieve.

1
  • Hi Hiroshi, like I mentioned, I was able to achieve this with simple configuration. In the plugin options, I set the classes strcuture to /%class_categories%/%postname%/. Then in the registration parameters, I set the rewrite parameters as described above. DM me on Twitter @seb2point0 if you would like more info on how I did this.
    – Sebastien
    Commented Jul 10, 2013 at 7:58

Your Answer

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

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