Now I am able to sort taxonomy terms by term_order using below snippets. But I am still seeking answer for the original question “How to do it using pre_get_terms”.
function foo_tax_order($orderby, $args){
return 't.term_order';
}
add_filter('get_terms_orderby', 'foo_tax_order', 10, 2);
Related Posts:
- How do I order pages and categories by ID or name in the same query?
- Why is my WP_Query not working when tax_query terms are an array?
- List taxonomy terms plus their latest post ordered by post date
- WP Query for Posts (Products) in Specific Category that has 2 Specific Tags (*AND* both tags not *OR*)
- How to add terms to my tax_query based off of the current post
- Empty tax_query array returns an empty array
- Get list of terms that have posts in another term
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- How to set multiple `orderby` in query argument?
- How to order posts by title after they have already been sorted by category
- How to Order a list of taxonomies? orderby?
- How to print term name inside wp post loop
- How can I order a post query’s results based on the number of matching taxonomy terms?
- Nested meta_query with multiple relation keys
- Ignoring initial articles (like ‘a’, ‘an’ or ‘the’) when sorting queries?
- Multiple relationship for multiple tax_query in WP_Query
- WP_Query orderby post__in remains ineffective in the Loop [closed]
- WP_Query orderby date not working
- WordPress tax_query “and” operator not functioning as desired
- Order by optional meta key?
- Sorting: custom query with orderby meta_value_num THEN by title
- Order by DESC, ASC in custom WP_Query
- WP_Query order by multiple meta keys & fields
- Show posts without term
- Conditional arguments for WP_Query and tax_query depending on if $somevar has a value
- Secondary Sort (fallback) for WP_Query
- Query Posts in a Predefined Order
- Escaping WP_Query tax_query when term has special character(s)
- Does tax_query really beats meta_query in all situations?
- How to get order of posts?
- Order posts by ID in the given order
- Custom WP_Query order by post_meta and (author) user_meta
- Sorting posts by custom date fields (non standard date format)
- Tax_query terms ID’s using variable
- How to order posts tag by tag?
- Get list of posts which have at least one term from a custom taxonomy with WP_Query
- WP_Query ordered by custom field that is a date string?
- WP_Query sort by comment meta data
- Order posts by tags count?
- Merge 2 args in one WP_Query and order it by date
- Orderby = none not working [duplicate]
- if wp_query taxonomy term have posts
- WP_query ‘orderby=none’ Problem
- Order posts by date and then by custom field
- WooCommerce: filter by parent product’s taxonomy and product variation’s meta data
- How to order a post type with meta_value_num and if meta_value_num does not exist then order by date
- Revolution Slider Orderby Two Custom Fields
- How to combine tax_query and date_query in WordPress
- Order posts ascending with number in title
- WordPress altering my custom query, How to fix it?
- Order by the results of a function with WP_query
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- Get random terms
- How to extend tag and category “Related Posts” query to custom post_type if the first 2 terms have no posts
- Using tax_query reverses my post_type argument in a custom WP_Query
- If orderby parameter using pre_get_posts is the same for multiple posts what fallback does the query use?
- Ordering Posts with Custom Taxonomy Terms Array
- How to order posts in wp_query by a meta_value of the corresponding author
- Find all product that contain terms with %keywords% in WP_Query
- Get term by custom term meta and taxonomy
- Order terms inside a select dropdown
- Order by menu structure
- tax_query shows no results if nothing is selected
- WP_Query order by date in meta_value
- WP_Tax_Query with post_tag not working
- get complex results set according to category structure
- How to use order RAND() on WordPress?
- Get array of current post term ID’s
- Show all parents and children in custom post type in right order
- Ordering by meta_value AND date NOT WORKING with wp_query
- WP_Query tax_query problem
- WP_Query orderby breaks when using AJAX?
- Order WP Query posts by custom order calculated from post meta values
- Custom Post order for homepage
- Query all posts in a given taxonomy
- Meta query with order by another custom field
- WP_Query with tax_query, order by most ‘matches’
- WordPress WP_Query orderby being overwritten
- tax_query OR with empty result returns all posts
- WP_Query Order by Specific Post ID First
- Order Posts by meta value AND published date
- How can I pick a single post from the latest 3?
- Wp query orderby ‘title’ doesn’t work
- WP_Query, tax_query and term_meta: How to?
- Is it possible to dynamically get queried term AND taxonomy?
- How can i simulate “taxonomy__in” in query?
- Pass array of taxonomy terms to wp_query
- How can I order Wp_Query hierarchically?
- How do I sort posts with multiple pages
- Sorting posts DESC based on the number of comments using WP_Query
- Formulate a url to show posts with both taxonomy terms
- pre_get_posts Remove tax_query Completely
- tax_query: Order by slug?
- WP_Query Excluding pages with Order is 0
- Order WP_Query by multiple fields, subtracting them from one another
- Complex Orderby Parameters: How to query with multiple orderby parameters using meta_value_num?
- pre_get_posts order by not working
- Taxonomy search/filter with multiple taxonomies and multiple taxonomy terms
- Order by slug in get_terms with multiple taxonomies
- Meta Query relation “AND” not working