0

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.

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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