以下是我使用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;
}
}
?>
答案 0 :(得分:1)
您的代码已损坏。你的意思是:
<?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;
}
}
?>
这是正确的PHP,应该可以正常工作。