admin管理员组文章数量:1335854
I'm using the CPT UI plugin to create a custom post type with a custom taxonomy. I'm finding however that the individual post page shows "No Results Found".
I'm using this page slug as the CPT custom rewrite slug: wbc-activity-page
The terms page is working correctly on this url: domain/wbc-activity-page/home/
The issue is that the post page is showing 'no results found' on the post's url: domain/wbc-activity-page/wbc-post-1/
This is my post type settings:
function cptui_register_my_cpts_wbc_activity() {
/**
* Post Type: WBC Activities.
*/
$labels = [
"name" => __( "WBC Activities", "mw-theme" ),
"singular_name" => __( "WBC Activity", "mw-theme" ),
];
$args = [
"label" => __( "WBC Activities", "mw-theme" ),
"labels" => $labels,
"description" => "",
"public" => true,
"publicly_queryable" => true,
"show_ui" => true,
"show_in_rest" => true,
"rest_base" => "",
"rest_controller_class" => "WP_REST_Posts_Controller",
"has_archive" => false,
"show_in_menu" => true,
"show_in_nav_menus" => true,
"delete_with_user" => false,
"exclude_from_search" => false,
"capability_type" => "post",
"map_meta_cap" => true,
"hierarchical" => false,
"rewrite" => [ "slug" => "wbc-activity-page", "with_front" => true ],
"query_var" => true,
"supports" => [ "title", "editor", "thumbnail", "custom-fields", "comments", "revisions" ],
"taxonomies" => [ "wbc_category" ],
];
register_post_type( "wbc_activity", $args );
}
add_action( 'init', 'cptui_register_my_cpts_wbc_activity' );
This is my custom taxonomy settings:
function cptui_register_my_taxes_wbc_category() {
/**
* Taxonomy: WBC Activity Categories.
*/
$labels = [
"name" => __( "WBC Activity Categories", "mw-theme" ),
"singular_name" => __( "WBC Activity Category", "mw-theme" ),
];
$args = [
"label" => __( "WBC Activity Categories", "mw-theme" ),
"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" => [ 'slug' => 'wbc-activity-page', 'with_front' => true, ],
"show_admin_column" => false,
"show_in_rest" => true,
"rest_base" => "wbc_category",
"rest_controller_class" => "WP_REST_Terms_Controller",
"show_in_quick_edit" => true,
];
register_taxonomy( "wbc_category", [ "wbc_activity" ], $args );
}
add_action( 'init', 'cptui_register_my_taxes_wbc_category' );
Is there something I'm missing here?
本文标签: plugins39No Results Found39 on single post for custom post type
版权声明:本文标题:plugins - 'No Results Found' on single post for custom post type 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742397483a2467216.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论