Intuitive Custom Post Order

If you are using the Intuitive Custom Post Order plugin to order the taxonomy terms for one or more taxonomies, make sure to go through the setup instructions below to preserve that order for facets that use these taxonomies as their data source, and have “Term order” set in their “Sort by” setting.
Setup
- First, create (or edit) a facet and set its data source to a taxonomy. You’re going to order the terms of this taxonomy with Intuitive CPO.
-

The “Sort by > Term order” facet setting. Set the facet’s “Sort by” option to “Term order”. Only the following facet types have this setting: Checkboxes, Dropdown, Radio, fSelect, Hierarchy, Hierarchy Select, and Color.
- Next, in Settings > Intuitive CPO > Sortable Taxonomies, enable all taxonomies that you want to order with this plugin.
-
Add one of the two snippets below to your (child) theme’s functions.php. Which one depends on if you are using WooCommerce, and if so, how you want to order product categories.

Enabling “Product categories” in the “Sortable Taxonomies” setting. If you are using WooCommerce, you need to decide if you enable “Product categories” under Sortable Taxonomies, because WooCommerce already has its own drag-and-drop ordering interface for product categories. If you enable this setting, you’re using Intuitive CPO’s drag-and-drop ordering interface, and if not, you’re using the default WooCommerce one.
If you are not using WooCommerce, or if you are using WooCommerce and you enabled “Product categories” under “Sortable Taxonomies”, add the following code snippet to your (child) theme’s functions.php to fix facet ordering when using “Term order”:
How to use custom PHP code?
PHP code can be added to your (child) theme's functions.php file. Alternatively, you can use the Custom Hooks add-on, or a code snippets plugin. More info
// Use if not using WooCommerce, // or if so, if "Product categories" is enabled under Sortable Taxonomies. add_filter( 'get_terms_args', function( $args, $taxonomies ) { if ( isset( $args['term_order'] ) ) { $args['orderby'] = 'term_order'; } return $args; }, 10, 2 ); add_filter( 'get_terms_orderby', function( $orderby, $query_vars, $taxonomies ) { return 'term_order' === $query_vars['orderby'] ? 't.term_order' : $orderby; }, 10, 3 );If you are using WooCommerce, and you disabled “Product categories” under “Sortable Taxonomies”, add the following snippet instead. It fixes taxonomy ordering for all taxonomies like the above snippet, but preserves WooCommerce drag-and-drop ordering for product categories (which happens by a term meta field named “order”):
How to use custom PHP code?
PHP code can be added to your (child) theme's functions.php file. Alternatively, you can use the Custom Hooks add-on, or a code snippets plugin. More info
// Use if "Product categories" is disabled under Sortable Taxonomies. add_filter( 'get_terms_args', function( $args, $taxonomies ) { if ( isset( $args['term_order'] ) && 'order' !== $args['meta_key'] ) { $args['orderby'] = 'term_order'; } return $args; }, 10, 2 ); add_filter( 'get_terms_orderby', function( $orderby, $query_vars, $taxonomies ) { return 'term_order' === $query_vars['orderby'] ? 't.term_order' : $orderby; }, 10, 3 ); - Next, order your taxonomy terms by dragging them into place in the term list screen(s).
- Last but not least: do a full re-index.