我已经创建了分类法,但我想为分类法使用不同的post模板,我该怎么做?
function create_topics_hierarchical_taxonomy() {
// Add new taxonomy, make it hierarchical like categories
//first do the translations part for GUI
$labels = array(
\'name\' => _x( \'cars\', \'taxonomy general name\' ),
\'singular_name\' => _x( \'cars\', \'taxonomy singular name\' ),
\'search_items\' => __( \'Search Topics\' ),
\'all_items\' => __( \'All Topics\' ),
\'parent_item\' => __( \'Parent Topic\' ),
\'parent_item_colon\' => __( \'Parent Topic:\' ),
\'edit_item\' => __( \'Edit Topic\' ),
\'update_item\' => __( \'Update Topic\' ),
\'add_new_item\' => __( \'Add New Topic\' ),
\'new_item_name\' => __( \'New Topic Name\' ),
\'menu_name\' => __( \'cars\' ),
);
// Now register the taxonomy
register_taxonomy(\'cars\',array(\'post\'), array(
\'hierarchical\' => true,
\'labels\' => $labels,
\'show_ui\' => true,
\'show_admin_column\' => true,
\'query_var\' => true,
\'rewrite\' => array( \'slug\' => \'cars\' ),
));