“Custom Post Type Permalinks” plugin URL strcuture

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…)

Read More

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

Related posts

2 comments

  1. 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

  2. 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.

Comments are closed.