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.

At present I'm using this permalink structure /%category%/%postname%/. There are some existing post type. I want to change permalink for image post type to image/%post_id%/, and don't want to affect other post type and their permalinks.

share|improve this question
add comment

2 Answers

This will be done when you register_post_type :

  $args = array(
        'rewrite' => array( 'slug' => 'book' ),
      ); 

    register_post_type( 'book', $args );

IMPORTANT ! Remember to go to wp-admin options > permalink and click SAVE on that page for the changes to take effect.

share|improve this answer
    
I'm using core post type "Image" (theme default). So how can i re-declare it? Please elaborate. I added above code in functions.php and changed 'book' to 'image' & it didn't work. –  Prateek Gupta May 6 '13 at 12:38
    
solved by myself.. :D thanks for reply. –  Prateek Gupta May 6 '13 at 13:45
    
Great! hope it helped. Have a nice day –  ThaWolf May 6 '13 at 15:31
add comment

I would give the Custom Post Type Permalinks plugin a try (it sounds like it will allow you to do exactly what you want).

Alternatively you could probably manually edit your rewrite rules (in .htaccess), however re-saving your permalink settings would probably reset your rules each time.

Hope that helps, have fun!

share|improve this answer
    
but that change only for custom post type, not for default one. How it will work for default post types? –  Prateek Gupta May 5 '13 at 19:07
    
solved by myself.. :D thanks for reply. –  Prateek Gupta May 6 '13 at 13:25
    
It's better etiquette to reply here with your solution in case someone else runs into the same problem. –  Jared Cobb May 6 '13 at 14:39
    
i didn't solve this. I just created a new post type named "Image" and called all arguments by using 'support' in argument array. Still there are some problems with it :( that it is calling wp default argument, while as i need theme functions in custom post type. Still finding this answer. Do u know abt it? –  Prateek Gupta May 6 '13 at 18:29
add comment

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.