1

Here is the code I used to print taxonomy images per specific vocabulary using Taxonomy Image:

<?php
$vid = 19;
$terms = taxonomy_node_get_terms_by_vocabulary($node,$vid);
$new_terms = array();
if ($terms) {
    foreach ($terms as $term) {
    $term = taxonomy_image_display($term->tid) as $image);
    print '<div class="color">' . $image . '</div>';
    $new_terms[] = $image;
    }
}   
?>
canintex
  • 638
  • 1
  • 7
  • 21

1 Answers1

1

Your code is broken. Did you mean:

<?php
$vid = 19;
$terms = taxonomy_node_get_terms_by_vocabulary($node,$vid);
$new_terms = array();
if ($terms) {
    foreach ($terms as $term) {
        $image = taxonomy_image_display($term->tid);
        print '<div class="color">' . $image . '</div>';
        $new_terms[] = $image;
    }
}   
?>

This is correct PHP and should work.

RotHorseKid
  • 298
  • 1
  • 6