好的,标题没有太大帮助,所以让我试着解释一下。
这是一个基于Genesis的网站。
我创建了一个CPT:
function cptui_register_my_cpts_livestreams() {
/**
* Post Type: live streams.
*/
$labels = array(
"name" => __( \'Live streams\', \'\' ),
"singular_name" => __( \'Live stream\', \'\' ),
"menu_name" => __( \'Live streams\', \'\' ),
"all_items" => __( \'All live streams\', \'\' ),
"add_new" => __( \'Add new live stream\', \'\' ),
"add_new_item" => __( \'Add new live stream\', \'\' ),
"edit_item" => __( \'Edit live stream\', \'\' ),
"view_item" => __( \'New live stream\', \'\' ),
"view_items" => __( \'View live streams\', \'\' ),
"search_items" => __( \'Search live streams\', \'\' ),
"archives" => __( \'Live streams\', \'\' ),
);
$args = array(
"label" => __( \'Live streams\', \'\' ),
"labels" => $labels,
"description" => "",
"public" => true,
"publicly_queryable" => true,
"show_ui" => true,
"show_in_rest" => false,
"rest_base" => "",
"has_archive" => true,
"show_in_menu" => true,
"exclude_from_search" => false,
"capability_type" => "post",
"map_meta_cap" => true,
"hierarchical" => false,
"rewrite" => array( "slug" => "live-stream", "with_front" => true ),
"query_var" => true,
"supports" => array( "title", "thumbnail", "genesis-cpt-archives-settings", \'genesis-seo\' ),
\'yarpp_support\' => true,
);
register_post_type( "livestreams", $args );
}
add_action( \'init\', \'cptui_register_my_cpts_livestreams\' );
我还创建了一个文件:
archive-livestreams.php不知什么原因当我去https://inthebunch.co.za/live-stream/ 它会将我重定向到该帖子类型中创建的最新帖子。
我清除了缓存,重新保存了永久链接等。。。有什么建议吗?