将此代码添加到函数中。php,
add_action( \'init\', \'build_taxonomies\', 0 );
function build_taxonomies() {
register_taxonomy( \'category\', \'post\', array(
\'hierarchical\' => true,
\'update_count_callback\' => \'_update_post_term_count\',
\'query_var\' => \'category_name\',
\'rewrite\' => did_action( \'init\' ) ? array(
\'hierarchical\' => false,
\'slug\' => get_option(\'category_base\') ? get_option(\'category_base\') : \'category\',
\'with_front\' => false) : false,
\'public\' => true,
\'show_ui\' => true,
\'_builtin\' => true,
) );
}