我的侧栏中有以下代码,列出了术语或自定义分类法,这些是名称、名字和姓氏。是否可以按姓氏而不是名字的字母顺序列出他们?
谢谢
<?php
$taxonomy = \'name\';
$tax_terms = get_terms($taxonomy);
?>
<ul>
<?php
foreach ($tax_terms as $tax_term) {
echo \'<li>\' . \'<a href="\' . esc_attr(get_term_link($tax_term, $taxonomy)) . \'"title="\' . sprintf( __( "View all posts in %s" ), $tax_term->name ) . \'" \' . \'>\' . $tax_term->name.\'</a></li>\';
}
?>
</ul>