請試試這個代碼寄存器中的新texonomy
function custom_taxonomy() {
register_taxonomy(
'custom_categories', //The name of the taxonomy. Name should be in slug form (must not contain capital letters or spaces).
'post_type', //post type name
array(
'hierarchical' => true,
'label' => 'Themes store', //Display name
'query_var' => true,
'rewrite' => array(
'slug' => 'themes', // This controls the base slug that will display before each term
'with_front' => false // Don't display the category base before
)
)
);
}
add_action('init', 'custom_taxonomy');
注:請主題function.php添加該代碼或您的插件
============================================= ======== ==================
function reg_cat() {
register_taxonomy_for_object_type('category','CUSTOM_POST_TYPE');
}
add_action('init', 'reg_cat');
這段代碼在自定義後類型texonomy部分工作職位類別顯示請參考
正確的,但是在產品發佈ISN」在類別中顯示。它的作品,只是不顯示在類別中。 – SlyMurphy