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 created a custom posts type cities and the code for its deceleration is register_post_type('City',$args);

  $labels = array(
'name' => _x('Cities', 'post type general name'),
'singular_name' => _x('City', 'post type singular name'),
......  );

and I Installed prime-strategy-bread-crumb to generate the breadcrumbs but the exact url for cities page is http://www.abc.com/wordpress/cities/ and the url generated by the breadcrumb is http://www.acb.com/wordpress/city/ which ultimately takes me to the archive page of post type city so do I have to make changes in the plugin file or is it all due to page url because the url of single city post is //www.abc.com/wordpress/city/shimla/ and code to display the breadcrumbs is in this page.

share|improve this question
    
abc.com/wordpress/city is correct, Labels does not matter to the urls/slug. –  M-R Dec 12 '12 at 10:38

1 Answer 1

up vote 0 down vote accepted

The Labels are for the use in the Adminsection of your Website.

If you want to change the slug in the URL of your CPT, use this values in your register_post_type function call.

$rewrite = array(
    'slug' => __( 'cities', 'your_textdomain' ),
    //......
)

$args = array(
    'rewrite' => $rewrite,
    //......
);
share|improve this answer
    
Thanks Fischi, it worked but it also change the permalink to my single post abc.com/wordpress/city/shimla in to abc.com/wordpress/cities/shimla and when I click on cities to it again takes me to cities archive page –  Abhimanue Tamang Dec 12 '12 at 11:53
    
Oh ok, I see. In this case, the better solution would be to create a redirect from the http://www.acb.com/wordpress/city/ page to the http://www.acb.com/wordpress/cities/. Then you got both flies with one clap. –  fischi Dec 12 '12 at 11:56
    
ok I am creating a wordpress theme so tell me how to redirect it –  Abhimanue Tamang Dec 12 '12 at 12:17
    
sorry fischi I wnat to re correct my comment your solution worked till the time I don't updated my permalinks but when I updated me permalink structure to /%category%/%postname%/ both the breadcrumb link and navigation link get converted to acb.com/wordpress/cities and again displaying the archive page of city post type –  Abhimanue Tamang Dec 12 '12 at 12:51
    
hae I found something similar to my problem Breadcrumbs with Custom Post Types? –  Abhimanue Tamang Dec 12 '12 at 13:14

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.