我有2个分类法(流派和艺术家)和自定义帖子类型(歌词)
我想得到的url结构是
CPT:/lyrs/-CPTArtist的存档页:/lyrs/artist/&/歌词/艺术家/歌曲名称/流派:/歌词/流派
我已经使用CPT pluginurl制作了CPT和分类法,这很好,但在其中一个分类法上,它给了我404页的错误
CPT:
$args = array(
"label" => __( "Lyrics", "sage" ),
"labels" => $labels,
"description" => "",
"public" => true,
"publicly_queryable" => true,
"show_ui" => true,
"delete_with_user" => false,
"show_in_rest" => true,
"rest_base" => "",
"rest_controller_class" => "WP_REST_Posts_Controller",
"has_archive" => "lyrics",
"show_in_menu" => true,
"show_in_nav_menus" => true,
"exclude_from_search" => false,
"capability_type" => "post",
"map_meta_cap" => true,
"hierarchical" => true,
"rewrite" => array( "slug" => "lyrics/%artis%",
"with_front" => true ),
"query_var" => true,
"supports" => array( "title", "editor", "thumbnail" ),
"taxonomies" => array( "genre", "artis" ),
);
类型税:
$args = array(
"label" => __( "Genre", "sage" ),
"labels" => $labels,
"public" => true,
"publicly_queryable" => true,
"hierarchical" => true,
"show_ui" => true,
"show_in_menu" => true,
"show_in_nav_menus" => true,
"query_var" => true,
"rewrite" => array( \'slug\' => \'lyrics\', \'with_front\' => true, ),
"show_admin_column" => true,
"show_in_rest" => true,
"rest_base" => "genre",
"rest_controller_class" => "WP_REST_Terms_Controller",
"show_in_quick_edit" => true,
);
艺人税:
$args = array(
"label" => __( "Artist", "sage" ),
"labels" => $labels,
"public" => true,
"publicly_queryable" => true,
"hierarchical" => true,
"show_ui" => true,
"show_in_menu" => true,
"show_in_nav_menus" => true,
"query_var" => true,
"rewrite" => array( \'slug\' => \'lyrics\', \'with_front\' => true, \'hierarchical\' => true, ),
"show_admin_column" => true,
"show_in_rest" => true,
"rest_base" => "artist",
"rest_controller_class" => "WP_REST_Terms_Controller",
"show_in_quick_edit" => true,
);