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'm trying to set up a new CPT called news (see code here: http://pastie.org/3148081) and I'm specifying the has_archive parameter.

I've set up a new template called archive-news.php and single-news.php but its not being used when I go to /news/ or the permalink on the site. Instead the default archive.php and single.php gets loaded.

I've flushed the rewrite rules but still does not work.

This is the first time I'm using the has_archive parameter but after lots of searching I still can't see what I doing wrong.

Hopefully it's just a stupid mistake somewhere that someone can spot for me.

share|improve this question
up vote 1 down vote accepted

Your custom post type is je_news. This means that your single and archive files should be called single-je_news.php and archive-je_news.php.

The has_archive option enables you to change the archive url, but it doesn't override what the templates should be named.

share|improve this answer
Thanks @VelvetBlues I just realised this myself and posted at the same time as you! – Brigante Jan 8 '12 at 12:32

Ok feeling really stupid now!! I had used the following when registering the post type

register_post_type( 'je_news' , $args );

But named the archive file archive-news.php obviously it should be archive-je_news.php.

All working now.

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.