您可以删除类别分类法,然后只需创建自己的类别分类法。
在我的示例中,我删除了post Categories分类法,并将其替换为Subjects分类法
add_action( \'init\', \'unregister_taxonomy\' );
function unregister_taxonomy() {
global $wp_taxonomies;
$taxonomy = \'category\';
if ( taxonomy_exists($taxonomy) ){
unset( $wp_taxonomies[$taxonomy] );
}
}
function article_subjects() {
$labels = array(
\'name\' => _x( \'Subjects\', \'Taxonomy General Name\', \'dc\' ),
\'singular_name\' => _x( \'Subject\', \'Taxonomy Singular Name\', \'dc\' ),
\'menu_name\' => __( \'Subjects\', \'dc\' ),
\'all_items\' => __( \'All Items\', \'dc\' ),
\'parent_item\' => __( \'Parent Item\', \'dc\' ),
\'parent_item_colon\' => __( \'Parent Item:\', \'dc\' ),
\'new_item_name\' => __( \'New Subject\', \'dc\' ),
\'add_new_item\' => __( \'Add New Item\', \'dc\' ),
\'edit_item\' => __( \'Edit Item\', \'dc\' ),
\'update_item\' => __( \'Update Item\', \'dc\' ),
\'separate_items_with_commas\' => __( \'Separate items with commas\', \'dc\' ),
\'search_items\' => __( \'Search Items\', \'dc\' ),
\'add_or_remove_items\' => __( \'Add or remove items\', \'dc\' ),
\'choose_from_most_used\' => __( \'Choose from the most used items\', \'dc\' ),
\'not_found\' => __( \'Not Found\', \'dc\' ),
);
$args = array(
\'labels\' => $labels,
\'hierarchical\' => false,
\'public\' => true,
\'show_ui\' => true,
\'show_admin_column\' => true,
\'show_in_nav_menus\' => true,
\'show_tagcloud\' => true,
);
register_taxonomy( \'article_subjects\', array( \'post\' ), $args );
}
add_action( \'init\', \'article_subjects\', 0 );