I don’t understand why the offset parameter for get_terms isn’t working. This should start from the 5th iteration excluding the 1st to 4th but still it display all the taxonomies on my end.
Here’s my code:
$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
) );
Any suggestion to my problem would greatly be appreciated.
Here you need also to apply your exclude terms in
wp_count_terms()
function:wp_count_terms()
function works asget_terms()
, so you can apply to it your excluded terms too.If not, you get all list like explained in first reference below.
References: