admin管理员组文章数量:1313121
Kind a new to wordpress. Trying to add two new taxonomis to woocommerce:
product_color
product_category
The taxonomies are added and I see them under products categories, I even can add them to products.
The problem is when I try to enter the archive page.
In the product_category
taxonomy every thing works fine, I enter the next uri product_category/asos/
and it works.
The problem happens when I try to enter the product_color
archive page in the next uri product_color/red/
and I get 404 page
This is the code I placed in functions.php file.
/**
* Create custom taxonomy for products
* product_company
*/
function product_company() {
$labels = array(
'name' => _x( 'manufacturer', 'manufacturer' ),
'singular_name' => _x( 'manufacturer', 'manufacturer'),
'search_items' => __( 'find a new manufacturer' ),
'all_items' => __( 'All manufacturers' ),
'parent_item' => __( 'category parent' ),
'parent_item_colon' => __( 'category parent:' ),
'edit_item' => __( 'Edit manufacturer' ),
'update_item' => __( 'Edit manufacturer' ),
'add_new_item' => __( 'Add a new manufacturer' ),
'new_item_name' => __( 'new manufacturer' ),
'menu_name' => __( 'יmanufacturers' ),
);
$args = array(
'labels' => $labels,
'hierarchical' => true,
'query_var' => true,
'rewrite' => true,
'show_admin_column' => true,
'public' => true,
'show_ui'=> true,
'show_admin_column '=> true,
);
register_taxonomy( 'product_category', 'product', $args );
}
add_action( 'init', 'product_company', 0 );
/**
* Create custom taxonomy for products
* product_color
*/
function product_color() {
$labels = array(
'name' => _x( 'color', 'color' ),
'singular_name' => _x( 'color', 'color' ),
'search_items' => __( 'find by color' ),
'all_items' => __( 'all colors' ),
'parent_item' => __( 'category parent' ),
'parent_item_colon' => __( 'category parent:' ),
'edit_item' => __( 'edit color' ),
'update_item' => __( 'update color' ),
'add_new_item' => __( 'add color new' ),
'new_item_name' => __( 'new color' ),
'menu_name' => __( 'colors' ),
);
$args = array(
'labels' => $labels,
'hierarchical' => false,
'query_var' => true,
'rewrite' => true,
'show_admin_column' => true,
'public' => true,
'show_ui'=> true,
'show_admin_column '=> true,
);
register_taxonomy( 'product_color', 'product', $args );
}
add_action( 'init', 'product_color', 0 );
本文标签: Custom taxonomy archive shows 404 error
版权声明:本文标题:Custom taxonomy archive shows 404 error 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741914006a2404612.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论