0

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.

1

1 Answer 1

0

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,
    //......
);
6
  • 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 Dec 12, 2012 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, 2012 at 11:56
  • ok I am creating a wordpress theme so tell me how to redirect it Dec 12, 2012 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 Dec 12, 2012 at 12:51
  • hae I found something similar to my problem Breadcrumbs with Custom Post Types? Dec 12, 2012 at 13:14

Your Answer

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

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