您是否尝试过使用“自定义分类法”对汽车进行分类?我认为分类法应该是一种更合适的方法。
您可以注册以下汽车品牌:
// Register Custom Taxonomy
function wpse_131586_custom_taxonomy() {
$labels = array(
\'name\' => _x( \'Brands\', \'Taxonomy General Name\', \'wpse\' ),
\'singular_name\' => _x( \'Brand\', \'Taxonomy Singular Name\', \'wpse\' ),
\'menu_name\' => __( \'Car Brands\', \'wpse\' ),
\'all_items\' => __( \'All Items\', \'wpse\' ),
\'parent_item\' => __( \'Parent Item\', \'wpse\' ),
\'parent_item_colon\' => __( \'Parent Item:\', \'wpse\' ),
\'new_item_name\' => __( \'New Item Name\', \'wpse\' ),
\'add_new_item\' => __( \'Add New Item\', \'wpse\' ),
\'edit_item\' => __( \'Edit Item\', \'wpse\' ),
\'update_item\' => __( \'Update Item\', \'wpse\' ),
\'separate_items_with_commas\' => __( \'Separate items with commas\', \'wpse\' ),
\'search_items\' => __( \'Search Items\', \'wpse\' ),
\'add_or_remove_items\' => __( \'Add or remove items\', \'wpse\' ),
\'choose_from_most_used\' => __( \'Choose from the most used items\', \'wpse\' ),
\'not_found\' => __( \'Not Found\', \'wpse\' ),
);
$args = array(
\'labels\' => $labels,
\'hierarchical\' => true,
\'public\' => true,
\'show_ui\' => true,
\'show_admin_column\' => true,
\'show_in_nav_menus\' => true,
\'show_tagcloud\' => true,
);
//Change \'cars\' to your post type accordingly
register_taxonomy( \'car_brand\', \'cars\', $args );
}
// Hook into the \'init\' action
add_action( \'init\', \'wpse_131586_custom_taxonomy\', 0 );
希望您能了解注册汽车类型自定义分类法的想法。