Get Taxonomy Terms for a Vocabulary


/ Published in: HTML
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php if (count($taxonomy)): ?>
  2. <?php
  3. $terms = taxonomy_node_get_terms_by_vocabulary($node->nid, 1);
  4. foreach ($terms as $term) {
  5. $tags[] = l($term->name, taxonomy_term_path($term));
  6. }
  7. if ($tags){
  8. print t("Professional Areas") . ": " . implode(' | ', $tags);
  9. } ?>
  10. <br />
  11. <?php
  12. $terms = taxonomy_node_get_terms_by_vocabulary($node->nid, 2);
  13. foreach ($terms as $term) {
  14. $tagsTwo[] = l($term->name, taxonomy_term_path($term));
  15. }
  16. if ($tagsTwo){
  17. print t("Focus Areas") . ": " . implode(' | ', $tagsTwo);
  18. }?>
  19. <?php endif; ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.