WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:


and its working for other post types.

share|improve this question

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

share|improve this answer

Your Answer


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.