我在菜单中加入了一个类别。当我点击菜单中的类别时,这个类别没有显示任何内容。我预计至少会显示一篇自定义帖子类型的已发布帖子。
我的自定义帖子类型具有以下链接:
mysite.com/customPostTypeName/PostTitle
我的分类网站有以下链接:
mysite.com/category/testCategorie
我想在菜单中显示一个链接,该链接显示特定类别的所有帖子和自定义帖子类型。
有什么建议我做错了什么?
感谢您的回复!
UPDATE
我的帖子类型如下所示:
add_action( \'init\', \'cptui_register_my_cpts_matratze\' );
function cptui_register_my_cpts_matratze() {
$labels = array(
"name" => __( \'Matratzen\', \'\' ),
"singular_name" => __( \'Matratze\', \'\' ),
);
$args = array(
"label" => __( \'Matratzen\', \'\' ),
"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" => "matratze", "with_front" => true ),
"query_var" => true,
"supports" => array( "title", "editor", "thumbnail", "excerpt", "trackbacks", "custom-fields", "comments", "revisions", "author", "page-attributes", "post-formats" ),
"taxonomies" => array( "category", "post_tag" ),
);
register_post_type( "matratze", $args );
// End of cptui_register_my_cpts_matratze()
}
我还没有注册任何分类法。