我在哪里可以看到我的定制帖子类型档案模板?

时间:2011-03-02 作者:Amit Erandole

我正在使用wordpress 3.1,并且有自定义的白皮书帖子类型。我的单一白皮书模板似乎正在运行。但归档模板(archive whitepaper.php)并非如此。

这是在我将新的“has\\u archive”参数添加到我的register post type函数之后。我试着将其设置为真,并试着将其设置为一份“白皮书”

但当我点击url示例时。我得到了一个白色的屏幕。这是我的代码:

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\'
 )
);
我做错了什么?

1 个回复
SO网友:MikeSchinkel

保存永久链接以刷新重写规则:

Saving Permalinks in WordPress to Flush rewrite rules

结束

相关推荐