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 am working with wordpress 3.1 and have custom post type of whitepaper. My single-whitepaper template seems to be working. But the archive template (archive-whitepaper.php) is not.

And this after I have added the new 'has_archive' parameter to my register post type function. I have tried setting it to true and I have tried setting it to a slug of 'whitepaper'

But when I hit the url example.com/whitepaper, I get a white screen. Here's my code:

register_post_type( 'whitepaper', array(
               'labels' => array(
               'name' => __( 'Whitepapers' ),
               'singular_name' => __( 'Whitepaper' ),
               'add_new' => __( 'Add New' ),
               'add_new_item' => __( 'Add New Whitepaper' ),
               'edit' => __( 'Edit' ),
               'edit_item' => __( 'Edit Whitepaper' ),
               'new_item' => __( 'New Whitepaper' ),
               'view' => __( 'View Whitepaper' ),
               'view_item' => __( 'View Whitepaper' ),
               'search_items' => __( 'Search Whitepapers' ),
               'not_found' => __( 'No whitepapers found' ),
               'not_found_in_trash' => __( 'No whitepapers found in Trash' ),
               'description' => __( 'Whitepaper type is used to post recommended viewing content for our users.' )                  
                  'public' => true,
                  'show_ui' => true,
                  'publicly_queryable' => true,
                  'exclude_from_search' => false,
          'menu_position' => 5,
          'menu_icon' => get_stylesheet_directory_uri() . '/images/whitepaper.png',
          'query_var' => true,
          'supports' => array( 'title', 'editor', 'excerpt', 'custom-fields', 'thumbnail' ),
          'can_export' => true,
          'has_archive' => 'whitepaper'

What am I doing wrong?

share|improve this question

Hi @Amit Erandole:

Save permalinks to flush your rewrite rules:

Saving Permalinks in WordPress to Flush rewrite rules

share|improve this answer
Thanks mike for the tip but there was a syntax error in my template. Issue solved – Amit Erandole Mar 2 '11 at 7:41
@Amit Erandole - What was the syntax error? I copied your code into my test site and it worked fine. – MikeSchinkel Mar 2 '11 at 7:49
@Mike - Just visiting the permalinks page should be enough. – t31os Mar 2 '11 at 16:56
@t31os - Visiting the permalinks page should be enough for what? To see the error? I didn't see any errors on my test site. – MikeSchinkel Mar 2 '11 at 20:42
@Mike - To update the rewrite rules silly ;-) – t31os Mar 2 '11 at 22:33

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.