get_the_term_list without links in 3.1

What function will display custom taxonomies associated with a post as text?

I’m currently using get_the_term_list which works great for a singular page but not so much when using a taxonomy in the archive-postype.php permalink title tag.

Related posts

Leave a Reply

5 comments

  1. $terms = wp_list_pluck( get_the_terms( get_the_ID(), 'your_taxonomy' ), 'name');
    

    Here $terms is an array, so you can use a foreach loop.

    foreach( $terms as $term ) {
      echo $term;
    }
    
  2. I need the same and tried Zack solution that works great. For instance, if you need onlye the term to put in css id or class.
    Only one anotation about the solution, the function is bad called, properly is “get_the_term_list”.

    I show my example:

    $terms = get_the_term_list( $post->ID, 'your_taxonomy_name' );
    $terms = strip_tags( $terms );