Taxonomy terms in Drupal are usually displayed by printing out the $terms variable in the node template. This is great in most cases, but once in awhile you'll need to isolate one or two of these terms and output them as separate individual links, rather than as part of the main list.
(Take, for example, a case where you create a vocabulary based on story authors, making each author a term. This is a really useful way to organize archival content, but you probably don't want the author's name output on the same line as the story's other tags.)
There are several solutions to this puzzle. Spend some time looking at the suggestions found here —http://drupal.org/node/133223 — to see a few of them. If you don't have time to sift through all that try the following solution, which is adapted from code on the page just referenced.
One note: You'll need to know the vocabulary ID of the term you are referencing, so use Devel to find the taxonomy vocabulary id. Then add this function to your template.php file:
#000000">#0000BB"><?php
#007700">function #0000BB">your#007700">-#0000BB">theme#007700">-#0000BB">name_taxonomy_links#007700">(#0000BB">$node#007700">, #0000BB">$vid#007700">) {
if (#0000BB">count#007700">(#0000BB">$node#007700">->#0000BB">taxonomy#007700">)){
foreach (#0000BB">$node#007700">->#0000BB">taxonomy #007700">as #0000BB">$term#007700">) {
if (#0000BB">$term#007700">->#0000BB">vid #007700">== #0000BB">$vid#007700">){
#0000BB">$thelink #007700">= #0000BB">l#007700">(#0000BB">$term#007700">->#0000BB">name#007700">, #0000BB">taxonomy_term_path#007700">(#0000BB">$term#007700">));
return #0000BB">$thelink#007700">;
}
}
}
}
#0000BB">?>Now, just create a new node template file (of course, this should be specific to your content type, ie node-story.tpl.php), and add the following:
#000000">
#0000BB"><?php #007700">print #0000BB">your#007700">-#0000BB">theme#007700">-#0000BB">name_taxonomy_links#007700">(#0000BB">$node#007700">, #0000BB">$VID#007700">); #0000BB">?> //$VID is the id of the vocabulary you want....
?>Of course, you'll need to remove the 'terms' variable, and probably output whatever remaining terms are left in a similar fashion, but that's a quick way to do it.
