基本上,除了顶级页面(例如,类别、归档、单篇文章、自定义文章类型等),所有内容都可以正常工作。
我有3个自定义帖子类型和4个自定义分类法(每个自定义分类法分别附加到一个帖子类型,还有一个分类法附加到所有帖子类型)。以下是这两个项目的设置:
register_taxonomy(
\'newsroom-topics\',
array ( 0 => \'news-post\',),
array (
\'hierarchical\' => true,
\'label\' => \'Newsroom Topics\',
\'show_ui\' => true,
\'query_var\' => true,
\'rewrite\' => array(\'slug\' => \'/\'),
\'singular_label\' => \'Newsroom Topic\'
)
);
register_post_type(
\'news-post\',
array(
\'label\' => \'Newsroom Posts\',
\'description\' => \'\',
\'public\' => true,
\'show_ui\' => true,
\'show_in_menu\' => true,
\'capability_type\' => \'post\',
\'hierarchical\' => false,
\'rewrite\' => array(\'slug\' => \'newsroom\'),
\'query_var\' => true,
\'has_archive\' => true,
\'exclude_from_search\' => false,
\'menu_position\' => 5,
\'supports\' => array(\'title\',\'editor\',\'excerpt\',\'trackbacks\',\'custom-fields\',\'comments\',\'revisions\',\'thumbnail\',\'author\',\'page-attributes\',\'post-formats\',),
\'taxonomies\' => array(\'content-type\',\'newsroom-topics\',),
\'labels\' => array (
\'name\' => \'Newsroom Posts\',
\'singular_name\' => \'Newsroom Post\',
\'menu_name\' => \'Newsroom Posts\',
\'add_new\' => \'Add Newsroom Post\',
\'add_new_item\' => \'Add New Newsroom Post\',
\'edit\' => \'Edit\',
\'edit_item\' => \'Edit Newsroom Post\',
\'new_item\' => \'New Newsroom Post\',
\'view\' => \'View Newsroom Post\',
\'view_item\' => \'View Newsroom Post\',
\'search_items\' => \'Search Newsroom Posts\',
\'not_found\' => \'No Newsroom Posts Found\',
\'not_found_in_trash\' => \'No Newsroom Posts Found in Trash\',
\'parent\' => \'Parent Newsroom Post\',
),) );
有没有想过为什么会发生这种情况?
更新时间:
因此,在寻找了一段时间为什么会发生这种情况后,我刚刚发布了这篇文章,我发现了问题所在。在阅读设置中,我的首页被设置为显示为静态页面,当我将其更改回默认页面时,一切正常。