Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a custom post type named Reportage, added in functions.php:

add_action( 'init', 'create_post_type' );
function create_post_type() {
    register_post_type( 'reportage',
        array(
            'labels' => array(
                'name' => __( 'Reportage' ),
                'singular_name' => __( 'Reportage' )
            ),
            'public' => true,
            'taxonomies' => array('category'),
            'query_var' => true
        )
    );

    register_taxonomy_for_object_type('category', 'reportage');
}

Now I want to use this custom url structure: "/%posttype%/%category%/%postname%", but the permalinks gets generated as (and redirected to when visited) "/%posttype%/%postname%". How do I change the permalinks structure to "/%posttype%/%category%/%postname%"?

I need to have "/%posttype%" to route to a regular page with the same name as the posttype (Reportage), this works fine now.

I also need to "/%posttype%/%category%" to route to something like the category.php file.

How can I make this work?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

My plugin Custom Post Permalinks does this.

http://wordpress.org/extend/plugins/custom-post-permalinks

share|improve this answer
    
Thanks, I'll try it out first thing tomorrow. –  Tirithen Feb 16 '11 at 21:22
    
Works like a charm! –  Tirithen Feb 17 '11 at 10:35
    
I am not able to go to this link. is this plugin deleted from wordpress or replaced with different name? please send me a link –  Arpita Aug 31 '11 at 2:13
2  
The plugin isn't supported by the original author anymore due to being misused and causing headaches for those not careful with it. –  Manny Fleurmond Aug 31 '11 at 6:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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