Problem about display product with custom post type
-
Hi! every body! Please help me.
I have a custom post type: product:
add_action(‘init’, ‘create_product_post_type’);
function create_product_post_type(){
register_post_type(‘product’,
array(
‘labels’ => array(
‘name’ => __(‘S?n ph?m’),
‘singular_name’ => __(‘S?n ph?m’),
‘add_new’ => __(‘Thêm m?i’),
‘add_new_item’ => __(‘Thêm m?i s?n ph?m’),
‘edit’ => __(‘Edit’),
‘edit_item’ => __(‘S?a th?ng tin’),
‘new_item’ => __(‘New Product’),
‘view’ => __(‘View Product’),
‘view_item’ => __(‘View Product’),
‘search_items’ => __(‘Tìm ki?m s?n ph?m’),
‘not_found’ => __(‘Kh?ng có s?n ph?m nào ???c tìm th?y’),
‘not_found_in_trash’ => __(‘Kh?ng có s?n ph?m nào ???c tìm th?y trong thùng rác’)
),
‘public’ => true,
‘show_ui’ => true,
‘publicy_queryable’ => true,
‘exclude_from_search’ => false,
‘menu_position’ => 5,
‘menu_icon’ => get_stylesheet_directory_uri(). ‘/images/product.png’,
‘hierarchical’ => true,
‘query_var’ => true,
‘supports’ => array(
‘title’, ‘editor’, ‘comments’, ‘author’, ‘excerpt’, ‘thumbnail’,
‘custom-fields’
),
‘rewrite’ => array(‘slug’ => ‘product’, ‘with_front’ => false),
‘can_export’ => true,
//’register_meta_box_cb’ => ‘call_to_function_do_something’,
‘description’ => __(‘Product description here.’)
)
);
register_taxonomy(‘category’,’product’,array(‘hierarchical’=>true,’label’=>__(‘Danh m?c s?n ph?m’)));
}But, I can’t display categorie of “product”, When i click into link category, It’s display all product in (custom post type)”product”.
I want it displayed on the list that I has categorized but when clicked it displays all the products.So! I dont know why. Please! Help me!
Sorry My English very bad:(
Thanks alots
- The topic ‘Problem about display product with custom post type’ is closed to new replies.