How can I print the taxonomy term name in node.tpl.php?

The following prints the name as a link, but I just want to print the name as text so I can make it a <div> class.

<?php print $terms ?>

1 Answer 1

$term = current($node->taxonomy);
echo '<div class="some-class">' . $term->name . '</div>';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.