I’ve set up a taxonomy in my functions.php of wordpress (I made it within a custom post type):
add_action( 'init', 'create_post_type' );
function create_post_type() {
register_post_type( 'clip',
array(
'labels' => array(
'name' => __( 'Clips' ),
'singular_name' => __( 'Clip' )
),
'public' => true,
'has_archive' => true,
'hierarchical' => true,
'supports' => array('editor', 'excerpt', 'thumbnail', 'title')
)
);
// Add new taxonomy, NOT hierarchical (like tags)
$labels = array(
'name' => _x( 'Directors', 'taxonomy general name' ),
'singular_name' => _x( 'Director', 'taxonomy singular name' ),
'search_items' => __( 'Search Directors' ),
'popular_items' => __( 'Popular Directors' ),
'all_items' => __( 'All Directors' ),
'parent_item' => null,
'parent_item_colon' => null,
'edit_item' => __( 'Edit Director' ),
'update_item' => __( 'Update Director' ),
'add_new_item' => __( 'Add New Director' ),
'new_item_name' => __( 'New Director Name' ),
'separate_items_with_commas' => __( 'Separate Directors with commas' ),
'add_or_remove_items' => __( 'Add or remove Directors' ),
'choose_from_most_used' => __( 'Choose from the most used Directors' ),
'menu_name' => __( 'Directors' ),
);
register_taxonomy('director','clip',array(
'hierarchical' => false,
'labels' => $labels,
'show_ui' => true,
'update_count_callback' => '_update_post_term_count',
'query_var' => true,
'rewrite' => array( 'slug' => 'director' ),
));
} //end clip creation PT
and now I want to call it out but can’t seem to.
This is the method I am using but is not working.
echo get_the_term_list( $post->ID, 'director', 'director: ', ', ', '' );
do you know how to fix this?
1 comment