Я создал собственную таксономию для Woocommerce со следующим кодом:
// Register Custom Taxonomy
function ess_custom_taxonomy_Item() {
$labels = array(
'name' => 'collections',
'singular_name' => 'Collection',
'menu_name' => 'Collections',
'all_items' => 'All Collections',
'parent_item' => 'Parent Collection',
'parent_item_colon' => 'Parent Collection:',
'new_item_name' => 'New Collection Name',
'add_new_item' => 'Add New Collection',
'edit_item' => 'Edit Collection',
'update_item' => 'Update Collection',
'separate_items_with_commas' => 'Separate Collection with commas',
'search_items' => 'Search Collections',
'add_or_remove_items' => 'Add or remove Collections',
'choose_from_most_used' => 'Choose from the most used Collections',
);
$args = array(
'labels' => $labels,
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_tagcloud' => true,
'get_query_var' => true,
);
register_taxonomy( 'product-collections', 'product', $args );
}
add_action( 'init', 'ess_custom_taxonomy_item', 0 );
Все работает отлично, я могу добавить термины для пользовательской таксономии и добавить продукты к каждому термину, но когда я перехожу на страницу термина, я получаю страницу 404.
Я ищу способ, которым, когда я захожу на страницу терминов, я вижу списки товаров так же, как я вижу товары, когда я захожу на страницу магазина Woocommerce.