I want to preface this by saying we HAVE tried saving and re-saving the permalinks structure.
我们正在开发一个自定义主题,并且在主题中有一些自定义的帖子类型。下面是其中一个示例。
function broadcast_post_types() {
$labels = array(
\'name\' => \'Broadcasts\',
\'singular_name\' => \'Broadcast\',
\'menu_name\' => \'Broadcasts\',
\'name_admin_bar\' => \'Broadcasts\',
\'add_new\' => \'Add New Broadcast\',
\'add_new_item\' => \'Add New Broadcast\',
\'new_item\' => \'New Broadcast\',
\'edit_item\' => \'Edit Broadcast\',
\'view_item\' => \'View Broadcast\',
\'all_items\' => \'All Broadcasts\',
\'search_items\' => \'Search Broadcasts\',
\'parent_item_colon\' => \'Parent Broadcasts:\',
\'not_found\' => \'No Broadcasts found.\',
\'not_found_in_trash\' => \'No Broadcasts found in Trash.\'
);
$args = array(
\'public\' => true,
\'labels\' => $labels,
\'description\' => \'These broadcasts are a replay of Wisco Radio Content\',
\'menu_icon\' => \'dashicons-format-video\',
\'hierarchical\'=> true,
\'has-archive\' => true
);
register_post_type( \'broadcast\', $args );
我们遇到了一个问题,当我们尝试访问这个归档页面(localhost/broadcast/)时,它会将我们带到一个帖子(localhost/broadcast/post1)或404。
我们已尝试重置permalink设置,并已确保has-archive
设置为true。
我们正在使用MAMP创建本地环境,并在线托管了一个沙盒,这在两个位置都有发生。有什么想法吗?