Using strip_tags() Can get complicated if you want to show your terms as an HTML list.
Here, there's something for you. $raw set to true (or anything that's not empty) will just create an inline list with the $separator of your choice, if not, it will generate an HTML list without links. If you want your list to have a styled title, set the $titletag to, say H1 or H2. If you don't want a title, just leave $title empty.
function show_tax($taxname, $title, $title_tag, $raw, $separator){
$terms = get_the_terms($post->ID, $taxname);
$out = '';
if (!empty($title)){
if(empty($title_tag)){
$title_tag = 'span';
}
$out .= '<'.$title_tag.'>'.$title.'</'.$title_tag.'>';
}
if (!empty($raw)){
$out = implode($separator, $terms);
}
else{
$out .= '<ul>';
foreach ( $terms as $term ){
$out .='<li>'.$term->name.'</li> ';
}
$out .= '</ul>';
}
return $out;
}
Example of use:
echo show_tax('people', 'PEOPLE', 'h3', '', ''); // An html list with PEOPLE as title
echo show_tax('people', 'PEOPLE:', '', true, ','); // An inline list with PEOPLE: as before text