我已经注册了一个名为“Services”的自定义帖子类型,但当我给这篇帖子提供模板“single Services.php”时,它不接受这个,而是选择了“homepage.php”模板,你能告诉我这个问题吗?它也没有使用“archive services.php”模板,而是使用blog模板(index.php)
使现代化代码如下:
add_action(\'init\', \'services_register\');
function services_register() {
$labels = array(
\'name\' => _x(\'Services\', \'post type general name\'),
\'singular_name\' => _x(\'Service\', \'post type singular name\'),
\'add_new\' => _x(\'Add New\', \'service\'),
\'add_new_item\' => __(\'Add New Service\'),
\'edit_item\' => __(\'Edit Service\'),
\'new_item\' => __(\'New Service\'),
\'view_item\' => __(\'View Service\'),
\'search_items\' => __(\'Search Service\'),
\'not_found\' => __(\'Nothing found\'),
\'not_found_in_trash\' => __(\'Nothing found in Trash\'),
\'parent_item_colon\' => \'\'
);
$args = array(
\'labels\' => $labels,
\'public\' => true,
\'publicly_queryable\' => true,
\'show_ui\' => true,
\'query_var\' => true,
\'menu_icon\' => null,
\'rewrite\' => true,
\'capability_type\' => \'post\',
\'hierarchical\' => false,
\'menu_position\' => null,
\'supports\' => array(\'title\',\'editor\',\'thumbnail\')
);
register_post_type( \'services\' , $args );
}