我已经创建了6种不同的自定义帖子类型,每种类型都有自己的存档。我还创建了一个与自定义帖子类型同名的页面,并为每个页面创建了一个名为“About”的子页面。
出于某种原因,我只能访问一个自定义帖子类型下的About页面,尽管我已经检查了代码是否正确functions.php
对所有人来说都是一样的。
现场正在测试中。isthispavilion。com;每个的代码是:
add_action("init", "zac_init");
function zac_init() {
$labels = array(
\'name\' => _x(\'Shrike\', \'post type general name\'),
\'singular_name\' => _x(\'Shrike\', \'post type singular name\'),
\'add_new\' => _x(\'Add New\', \'shrike\'),
\'add_new_item\' => __(\'Add New Piece\'),
\'edit_item\' => __(\'Edit Piece\'),
\'new_item\' => __(\'New Piece\'),
\'view_item\' => __(\'View Piece\'),
\'search_items\' => __(\'Search Pieces\'),
\'not_found\' => __(\'No pieces found\'),
\'not_found_in_trash\' => __(\'No pieces found in Trash\'),
);
$args = array(
\'labels\' => $labels,
\'public\' => true,
\'publicly_queryable\' => true,
\'query_var\' => true,
\'rewrite\' => array(\'slug\' => \'shrike\'),
\'capability_type\' => \'post\',
\'hierarchical\' => false,
\'menu_position\' => null,
\'supports\' => array(\'title\', \'editor\', \'author\', \'custom-fields\', \'thumbnail\', \'revisions\', \'page-attributes\', \'post-formats\', \'excerpt\'),
\'taxonomies\' => array(\'category\', \'post_tag\', \'portfolio\'),
\'with_front\' => false,
\'has_archive\' => \'shrike\',
);
register_post_type(\'shrike\', $args, $taxonomies);
}
正如你所见,
http://test.isthispavilion.com/shrike/about/ 很好,但是
http://test.isthispavilion.com/darya/about/ 是“未找到”。
有没有人经历过类似的问题?是什么原因造成的?