これがあなたがそれをする方法です:
get_the_term_list( $post->ID, 'level', 'Level: ', ', ', '' );
参照:http ://codex.wordpress.org/Function_Reference/get_the_term_list
編集:
に編集get_the_term_list
_wp-includes/category-template.php
/**
* Retrieve a post's terms as a list with specified format.
*
* @since 2.5.0
*
* @param int $id Post ID.
* @param string $taxonomy Taxonomy name.
* @param string $before Optional. Before list.
* @param string $sep Optional. Separate items using this.
* @param string $after Optional. After list.
* @param string $beforeEach Optional. After each term.
* @return string
*/
function get_the_term_list( $id, $taxonomy, $before = '', $sep = '', $after = '', $beforeEach = '' ) {
$terms = get_the_terms( $id, $taxonomy );
if ( is_wp_error( $terms ) )
return $terms;
if ( empty( $terms ) )
return false;
foreach ( $terms as $term ) {
$link = get_term_link( $term, $taxonomy );
if ( is_wp_error( $link ) )
return $link;
$term_links[] = '<a href="' . esc_url( $link ) . '" rel="tag">'. $beforeEach . $term->name . '</a>';
}
$term_links = apply_filters( "term_links-$taxonomy", $term_links );
return $before . join( $sep, $term_links ) . $after;
}
使用法:
get_the_term_list( $post->ID, 'level', '', ', ', '', 'Level: ');