您好我正在尝试创建一个自定义帖子类型显示页面,但由于某种原因该页面无法正常工作,我被发送到 404.php。这是我的代码:
add_action('init' , 'business_manager_register');
function business_manager_register(){
//add custom post type
$args = array(
'label' => 'Business Managers',
'singular_label' => 'Business',
'public' => true,
'shouw_ui' => true,
'capability_type' => 'post',
'hierarchical' => true,
'has_archive' => true,
'supports' => array('title','editor','thumbnail'),
'rewrite' => array('slug' => 'businesses' , 'with_front' => false)
);
register_post_type('businesses' , $args);
}
现在为了显示它,我创建了文件 archive-businesses.php.Accoding 到我添加的 slug 链接应该是这样的:
link/businesses
但是当我尝试链接到它时,我得到了 404 错误,同样的事情发生在 single-businesses.php 上。我在这里做错了什么?