本文最后更新于 2022-10-14,已超过 365 天未更新,内容可能已失效。
$terms = get_terms($taxonomy,array('parent' => 0));
if ($terms) {
foreach($terms as $term) {
$term_children = get_term_children($term->term_id,$taxonomy);
if ( count( get_term_children( $term->term_id, $taxonomy ) ) > 0 ) {
foreach($term_children as $term_child_id) {
$term_child = get_term_by('id',$term_child_id,$taxonomy);
echo $term_child->slug . '<br>';
echo $term_child->name . '<br>';
echo $term_child->description . '<br>';
}
}
if ( count( get_term_children( $term->term_id, $taxonomy ) ) === 0 ) {
echo 'The term has no children to display.';
}
}
}
除非注明,子佩工作室 文章均为原创,转载请以链接形式标明本文地址。
![解决nginx: [emerg] mkdir() “/dev/shm/nginx-cache/wp” 的问题](https://oss.zptheme.com/wp-content/uploads/2023/06/1687188094-df5b941552926d5.png)




登录后即可发表评论
全部评论 (0)