Wordpress - 显示没有链接的分类术语 - (get_terms,the_terms,wp_tag_cloud)

有没有办法显示分类条款,而不是它们的链接? 我基本上想要显示我的分类标题下的所有条款“标题”,但没有链接。 我尝试了多种解决方案,如get_terms,get_the_terms,the_terms,wp_tag_cloud,但我无法找到解决方案。 谢谢。     
已邀请:
奇怪的解决方案返回所有条款,如果您只需要显示每个帖子项的条款,您可以使用:
$terms = wp_get_post_terms( $post->ID, 'taxonomy-term', array("fields" => "names") );
echo implode(', ',$terms);
确保正确的“分类学术语”正确!     
下面的代码检索所有术语的分类名称:
    $terms = get_terms( 'cars', array('fields'    => 'names')); 
    
$terms = get_terms("taxonomy");
                 $count = count($terms);
                 if($count > 0)
                     {
                         echo '<ul>';
                         foreach ($terms as $term) 
                             {
                                 echo '<li>'.$term->name.'</li>';
                             }
                         echo '</ul>';
                     }
    

要回复问题请先登录注册