Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Change term order of Taxonomy Frontend outpus › Reply To: Change term order of Taxonomy Frontend outpus
November 25, 2021 at 5:36 pm
#35741
Keymaster
Hi!
There is one hook, which may help you with that:
$terms = apply_filters('asp_fontend_get_taxonomy_terms',
$terms,
$taxonomy,
array(
'orderby' => $term_ordering[0],
'order' => $term_ordering[1],
'include' => $terms,
'include_ids' => $term_ids
),
$all_terms_were_requested
);
The $terms is the array of taxonomy term objects returned via the get_terms(..) core wordpress function.
You can either change the existing $terms array, or construct your own, and the plugin will display them in that order.
Before output, the plugin will do a minor change after this hook – it may move child terms after their corresponding parent term for correct displaying. If the terms are alrady ordered correclty (parent -> child -> grandchild -> etc..), it should not affect the final output.