Great function to quickly print taxonomy terms into node.tpl

Print taxonomy terms to your node with control over the vocabulary to print, if the term should link and label to display (if any) before the term(s).

Snippet:

<?php
//in template.php:
//if you don't have a template.php file, create one with a text editor & save it to your themes folder

#get Taxonomy Terms for node.tpl
function getTerm($label, $vid, $link) {
   
$node = node_load(array('nid'=>arg(1)));
    foreach((array)
$node->taxonomy as $term){
        if (
$term->vid == $vid){
            if (
$link){
               
$link_set[] = l($term->name, taxonomy_term_path($term));
            } else {
               
$link_set[] = $term->name;
            }
        }
    }
    if (!empty(
$link_set)){
       
$label = ($label) ? "<strong>$label </strong>" : "";
       
$link_set = $label.implode(', ', $link_set);
    }
    return
$link_set;
}

//in node.tpl:
print '<h1>'.getTerm(false, 1, false).'</h1>';

//functon arguments are: getTerm($label, $vid, $link)
//$label - the text to appear within <strong></strong> tags. If false no label will print
//$vid - the vocabulary ID of the category
//$link - if true the term(s) will link to a taxonomy view of all occurrences of this term(s) or, else put false.

//example: print '<h4>'.getTerm('Band:', 9, false).'</h4>';
//result in node: '<h4><strong>Band:' </strong>Foo Fighters</h4>'
?>