我在wordpress中的函数“register_post_type”有问题。wordpress中的register_post_type没有工作模板
我在functions.php中添加代码(主题路径):
add_action('init', 'events');
function events() {
register_post_type('events', array(
'labels' => array(
'name' => 'Wydarzenia',
'singular_name' => 'events',
),
'description' => 'Wydarzenia',
'public' => true,
'menu_position' => 20,
'supports' => array('title', 'editor', 'custom-fields', 'thumbnail', 'excerpt')
));
}
,然后加模板:单events.php和归档events.php但这没有工作......每次显示:指数.PHP ..
single.php中没有工作的事件......
在哪里的问题?谢谢!
'rewrite'=> array('slug'=> events')add slug –