Redux Frameworkを使用して1つのカスタムポストタイプを作成しています。カテゴリとそのカテゴリビューをカテゴリ別に直接作成してリンクに直接移動しますが、そのリンクは直接404ページに移動する必要があります。以下のコードをチェックして、私のコードで何がエラーであったかを教えてください。タクソノミーページ404 pgae
remove_action('init', 'brightness_service_register',10);
add_action('init', 'brightness_service_register',1);
function brightness_service_register()
{
$labels = array(
'name' => __('Service', 'brightness'),
'add_new' => __('Add New', 'brightness'),
'add_new_item' => __('Add New Service', 'brightness'),
'edit_item' => __('Edit Service', 'brightness'),
'new_item' => __('New Service', 'brightness'),
'view_item' => __('View Service', 'brightness'),
'search_items' => __('Search Service', 'brightness'),
'not_found' => __('No items found', 'brightness'),
'not_found_in_trash' => __('No items found in Trash', 'brightness'),
'parent_item_colon' => '',
'menu_name' => 'Service'
);
$args = array(
'labels' => $labels,
'menu_icon' => 'dashicons-images-alt2',
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'rewrite' => array('slug' => 'service', 'with_front' => false),
'exclude_from_search' => true,
'supports' => array('title', 'editor', 'thumbnail', 'page-attributes'
));
$taxonomy_labels = array(
'name' => __('Service Categories', 'taxonomy general name'),
'singular_name' => __('Service Category', 'taxonomy singular name'),
'search_items' => __('Search Category'),
'all_items' => __('All Service Categories'),
'parent_item' => __('Parent Service Category'),
'parent_item_colon' => __('Parent Location:'),
'edit_item' => __('Edit Category'),
'update_item' => __('Update Category'),
'add_new_item' => __('Add New Category'),
'new_item_name' => __('New Category Name'),
'menu_name' => __('Service Categories'),
);
$taxonomy_args = array(
'hierarchical' => true,
'labels' => $taxonomy_labels,
'rewrite' => array(
'slug' => 'service-categories', // This controls the base slug that will display before each term
'with_front' => false, // Don't display the category base before "/locations/"
'hierarchical' => true // This will allow URL's like "/locations/boston/cambridge/"),);
register_post_type('service' , $args);
register_taxonomy('coll-categories', 'service',$taxonomy_args);
}
から取ら
参照は、あなたがこれらのカテゴリを表示したときに、直接、404ページに行くと言っていますか? –
はい、エラーがあれば私のコードをチェックしてください@AmitJoshi – Vishit