4

Is there a way to display Taxonomy Terms without them being a link?

I basically want to display all the terms underneath my Taxonomy of "Headings," but without them being links.

I've tried multiple solutions such as get_terms, get_the_terms, the_terms, wp_tag_cloud but I was unable to find a solution.

Thanks.

Machavity
  • 30,841
  • 27
  • 92
  • 100
Brandon
  • 41
  • 1
  • 3

3 Answers3

2

The solution of bizarre returned all terms, if you need to display only the terms per post item you can use this:

$terms = wp_get_post_terms( $post->ID, 'taxonomy-term', array("fields" => "names") );
echo implode(', ',$terms);

Make sure to get the right "taxonomy-term" correct!

Jeroen
  • 21
  • 5
1

below code retrieve all terms name of a taxonomy :

    $terms = get_terms( 'cars', array('fields'    => 'names')); 
bizzr3
  • 1,925
  • 4
  • 24
  • 37
0
$terms = get_terms("taxonomy");
                 $count = count($terms);
                 if($count > 0)
                     {
                         echo '<ul>';
                         foreach ($terms as $term) 
                             {
                                 echo '<li>'.$term->name.'</li>';
                             }
                         echo '</ul>';
                     }
Vitaly
  • 1