0
我爲WooCommerce產品創建了自定義分類標準。產品不工作的自定義分類標準
function add_hunts_type(){
// Car Hunts
$cHunt_labels = array(
'name' => __('Hunts', 'pixar'),
'singular_name' => __('Hunt', 'pixar'),
'search_items' => __('Search Hunts', 'pixar'),
'all_items' => __('All Hunts', 'pixar'),
'parent_item' => __('Parent Hunt', 'pixar'),
'parent_item_colon' => __('Parent Hunt:', 'pixar'),
'edit_item' => __('Edit Hunt', 'pixar'),
'update_item' => __('Update Hunt', 'pixar'),
'add_new_item' => __('Add New Hunt', 'pixar'),
'new_item_name' => __('New Hunt', 'pixar'),
'menu_name' => __('Hunts', 'pixar'),
);
$cHunt_args = array(
'labels' => $cHunt_labels,
'hierarchical' => true,
'public' => true,
'show_ui' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_tagcloud' => true,
'query_var' => true,
'rewrite' => array('slug' => 'carhunt')
);
register_taxonomy('car_Hunt', 'product', $cHunt_args);
}
add_action('init', 'add_hunts_type', 0);
/* Flush rewrite rules for custom post types. */
add_action('after_switch_theme', 'flush_rewrite_rules');
這是工作時,我登錄到管理員。當我想從前端嘗試時,它不起作用。
- 我有變化的永久鏈接
- 我已刪除
.htaccess
和再生它 - 我還有其他的內在的東西這是正常
請讓我知道如果我錯過了一些東西。
感謝您help.This工作,但我忘了把破折號slugname( - )。好去繼續下去這裏有很多要學習的東西。 –
歡迎您:) –