我正在使用WAMP并安装最新版本的WordPress。我有一个自定义帖子类型创建使用以下。。。
function register_fruit() {
register_post_type(\'fruit\', array(
\'labels\' => array(
\'name\' => __( \'Fruit\' ),
),
\'public\' => true,
\'has_archive\' => true,
\'capability_type\' => \'post\',
\'rewrite\' => array("slug" => "/fruit", "with_front" => false),
\'supports\' => array( \'title\', \'editor\', \'thumbnail\'),
\'taxonomies\' => array(\'category\', \'post_tag\') // this is IMPORTANT
));
}
add_action(\'init\', \'register_fruit\', 0 );
例如,在查看单个项目时,此操作非常有效。。www.mydomain.com/fruit/apple
www.mydomain.com/fruit/orange
www.mydomain.com/fruit/pear
但如果我尝试查看存档页面,如。。。www.mydomain.com/fruit
我有404,我看不出问题出在哪里,有人能帮忙吗?