请试试这个代码寄存器中的新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