【发布时间】:2015-03-09 05:08:48
【问题描述】:
我通过此代码成功打印了整个分类树$voc = taxonomy_vocabulary_machine_name_load('product_sub_categories');
$tree = taxonomy_get_tree($voc->vid,0,NULL,TRUE);
foreach ($tree as $key => $term){
print $term->name."</br>";
}
,现在我想分别打印 parent 和 chile 以自定义主题,因为我已经有一个标记,其中 parent 有单独的
<p class="parent_class">Parent terms</p>
和孩子有单独的<ul class="child_class">Child terms</ul>。
我该怎么做,有人可以帮助我吗?
【问题讨论】: