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 tried many ways to display my custom post type as single-{post-type} and finally it works nicely once i used:

'rewrite'=> false,

before that, i used

'rewrite' => array( 'slug' => 'custom-post-type' )

but never works for me. Don't know where i made mistake. Right now i should feel happy cos its working without any error. But have a small confusion for the permalink because its display:

  1. localhost/myblog/?news=breaking-news
  2. instead of: localhost/myblog/news/breaking-news

anyone please provide me some idea how to get link like: localhost/myblog/news/breaking-news

my permalink structure selected:

http//myblog/sample-post/

and its working for other post types.

share|improve this question
add comment

1 Answer

Like you wrote above, you should use 'rewrite' => array( 'slug' => 'custom-post-type' ) when registering your post type.

share|improve this answer
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.