Taxonomy Terms Order and Auto Sort, Admin Sort description an usage
The Taxonomy Terms Order plugin is an easy way to control the sort for any taxonomies. The order is applied to the front side using the arguments:
‘orderby’ => ‘term_order’,
Example:
$argv = array( 'orderby' => 'term_order' ); get_terms('category', $argv);
Autosort OFF
No query sort will be changed, the terms will appear in the original order, per orderby argument. To retrieve the terms in the customised order you must use the term_order on the orderby parameter:
$argv = array( 'orderby' => 'term_order', 'hide_empty' => false ); get_terms('category', $argv);
See more info on the get_terms usage here
Autosort ON
The queries will be updated, and all terms will appear in the order you manually defined. This is recommended if you don’t want to change any theme code to apply the terms order
When using the AutoSort, you can still disable specific queries to use the customised order by add the ignore_term_order argument:
$argv = array( 'ignore_term_order' => TRUE ); get_terms('category', $argv);
Admin Sort
The code queries will be updated within the admin interface, the sort will also apply on this area too.
Both examples are exactly the same. What is missing for Autosort ON?
Sorry the paragraphs spacing seem to create a bit of fuzzy, I’ve inserted tome gaps to make it easier to follow.
so here is my code:
foreach( get_categories() as $category)
This displays all of my non-epty categories… Auto Sor is set to ON.. but the categories list that is generated by the above code is not in the shown sort order on the categories page.. in fact it seems to be random as it’s not sorted by category number either… please advise.
Steve
Try get_terms() instead which the free plugin support https://developer.wordpress.org/reference/functions/get_terms/
Wow! Great plugin, helped me a lot sorting my jodyshop.com shopping website categories exactly as needed 🙂 Many thanks.
Thank you for a great plugin. This helped us as we have VERY long categories and sub-categories at http://ChristianFind.Me – a yellow pages and business directory. We pray God blesses you for your spirit of excellence! Thanks again. 🙂