我有一个名为“business\\u selled”的自定义帖子类型,它没有读取archive-business\\u selled。php而是读取索引。php。但是,自定义帖子类型为,正确读取single-business\\u Seld。php。
这就是我注册自定义帖子类型的方式(最初是通过single-business\\u sell.php工作时使用的插件),然后我手动将以下代码添加到函数中。php:
register_post_type(\'Business_Sold\', array( \'label\' => \'Businesses Sold\',\'description\' => \'\',\'public\' => true,\'show_ui\' => true,\'show_in_menu\' => true,\'capability_type\' => \'post\',\'hierarchical\' => false,\'rewrite\' => array(\'slug\' => \'\'),\'query_var\' => true,\'has_archive\' => true,\'menu_position\' => 5,\'supports\' => array(\'title\',\'editor\',\'excerpt\',\'trackbacks\',\'custom-fields\',\'comments\',\'revisions\',\'thumbnail\',\'author\',\'page-attributes\',),\'taxonomies\' => array(\'category\',\'post_tag\',),\'labels\' => array (
\'name\' => \'Businesses Sold\',
\'singular_name\' => \'Business Sold\',
\'menu_name\' => \'Businesses Sold\',
\'add_new\' => \'Add Business Sold\',
\'add_new_item\' => \'Add New Business Sold\',
\'edit\' => \'Edit\',
\'edit_item\' => \'Edit Business Sold\',
\'new_item\' => \'New Business Sold\',
\'view\' => \'View Business Sold\',
\'view_item\' => \'View Business Sold\',
\'search_items\' => \'Search Businesses Sold\',
\'not_found\' => \'No Businesses Sold Found\',
\'not_found_in_trash\' => \'No Businesses Sold Found in Trash\',
\'parent\' => \'Parent Business Sold\',
),) );
你知道为什么会这样吗?