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/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?
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/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 asked Mar 2, 2011 at 7:25 Amit ErandoleAmit Erandole 7032 gold badges11 silver badges21 bronze badges1 Answer
Reset to default 4Save permalinks to flush your rewrite rules:
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745481805a4629590.html
评论列表(0条)