I have read a lot similar questions, but none of them saves me.
The site have multi-custom post type registered, others are ok to load a single page, except one,
function cabinet_post_type(){
$labels = array(
'name' => __('Cabinets'),
'singular_name' => __('Cabinet'),
'menu_name' => __('Cabinets'),
);
$args = array(
'description' => __('Cabinets'),
'labels' => $labels,
'supports' => array('title', 'editor', 'thumbnail', 'revisions', 'genesis-seo', 'genesis-cpt-archives-settings'),
'show_in_rest' => true,
'public' => true,
'hierarchical' => false,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'query_var' => true,
'menu_icon' => 'dashicons-editor-ul',
'has_archive' => true,
'can_export' => true,
'exclude_from_search' => false,
'yarpp_support' => true,
'publicly_queryable' => true,
'capability_type' => 'page'
);
register_post_type('cabinet', $args);}
I have no cue how that happens, could any big boss figure that out? so many thanks
I have read a lot similar questions, but none of them saves me.
The site have multi-custom post type registered, others are ok to load a single page, except one,
function cabinet_post_type(){
$labels = array(
'name' => __('Cabinets'),
'singular_name' => __('Cabinet'),
'menu_name' => __('Cabinets'),
);
$args = array(
'description' => __('Cabinets'),
'labels' => $labels,
'supports' => array('title', 'editor', 'thumbnail', 'revisions', 'genesis-seo', 'genesis-cpt-archives-settings'),
'show_in_rest' => true,
'public' => true,
'hierarchical' => false,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'query_var' => true,
'menu_icon' => 'dashicons-editor-ul',
'has_archive' => true,
'can_export' => true,
'exclude_from_search' => false,
'yarpp_support' => true,
'publicly_queryable' => true,
'capability_type' => 'page'
);
register_post_type('cabinet', $args);}
I have no cue how that happens, could any big boss figure that out? so many thanks
Share Improve this question asked Nov 13, 2020 at 16:24 Hao PhungHao Phung 1 2- Visiti permalinks to flush them. – vancoder Commented Nov 13, 2020 at 16:42
- As @vancoder said you can flush permalinks - Settings > Permalinks > Save – Bysander Commented Nov 23, 2020 at 16:52
1 Answer
Reset to default 0After a long search! I found a simple answer on a similar case. just add this line in the custom post type register
"taxonomies" => [ "category", "product-category" ],
then it will do the magic!