[英]get_terms() order not follow hierarchy
Here is how I get all terms, including children, of a custom hierarchical taxonomy: 这是我如何获取自定义分层分类法的所有术语(包括子代)的方法:
$args = array(
'taxonomy' => 'obra_tema',
);
$themes = get_terms($args);
Very simple. 很简单。 But instead the list look like that: 但是,列表看起来像这样:
The function return 函数返回
How can I show terms in the same order of dashboard? 如何以相同的仪表板顺序显示术语?
Have not tried this, but it should be something like this 还没有尝试过,但是应该是这样的
$args = array(
'taxonomy' => 'obra_tema',
'orderby' => 'id',
'order' => 'DESC',
);
$themes = get_terms($args);
You might have to adjust the order field or the order by direction. 您可能必须调整订单字段或按方向订购。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.