【发布时间】:2016-06-08 16:45:36
【问题描述】:
我不明白为什么 get_terms 的 offset 参数不起作用。这应该从第 5 次迭代开始,不包括第 1 次到第 4 次,但它仍然显示我的所有分类法。
这是我的代码:
$countterms = wp_count_terms( 'item_category' );
$offset = 4;
$number = $countterms - $offset;
$terms = get_terms( 'item_category', array(
'hide_empty' => true,
'orderby' => 'name',
'order' => 'ASC',
'exclude' => array(145,138,110,139,140,141,130,142,144,116,143),
'offset' => $offset,
'number' => $number
) );
对我的问题的任何建议将不胜感激。
【问题讨论】:
-
您是否发现控制台或调试日志文件中有任何错误?
标签: php wordpress offset categories custom-taxonomy