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've successfully added a custom post type.

            'labels' => array(
                'name' => __('Cases'),
                'singular_name' => __('Case')
            'public' => true,
            'has_archive' => true,
            'supports' => array('title', 'editor', 'thumbnail','custom-fields', 'page-attributes')


And I've created a page called "case" and I have my permalinks configured like this:


The problem I'm having now is that when I try to access url.com/case I don't get my page "case" but instead I'm looking at the custom post type "case". I think?

Every "case" has its own url --> url.com/case/xxx. I don't want to change this but instead be able to change the layout for the custom page "main" page that represents all the cases instead of a "page" called case.

Can this be done and how?

share|improve this question

I got it by searching some more on google.

'has_archive' => true,

This line is vital.

Found out I had to rename my custom template pages to archive-"the custom type name" which in this case was.


Because of this I could remove my "static" page called case and let the system pick the right template page for the custom post type.

share|improve this answer

In the arguments ($args) parameter of the register_post_type function, there is a variable named rewrite. By default it is true, try to set it to false.

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.