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?
- 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 DESC, ASC in custom WP_Query
- Show posts without term
- Secondary Sort (fallback) for WP_Query
- Query Posts in a Predefined Order
- WP_Query ordered by custom field that is a date string?
- 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
- Order posts ascending with number in title
- WordPress altering my custom query, How to fix it?
- Using tax_query reverses my post_type argument in a custom WP_Query
- WP_Query order by date in meta_value
- get complex results set according to category structure
- How to use order RAND() on WordPress?
- WP_Query tax_query problem
- Meta query with order by another custom field
- How can I pick a single post from the latest 3?
- Wp query orderby ‘title’ doesn’t work
- How can I order Wp_Query hierarchically?
- How do I sort posts with multiple pages
- Order WP_Query by multiple fields, subtracting them from one another
- List custom taxonomy terms sharing posts with a term from a second custom taxonomy
- SQL: What is wrong with the following query (generated by WordPress WP_Query, ordering prices)
- Order By table field comment_status in WordPress > 4.0
- Complex WP_Query order request: DESC by day, but then ASC by time
- WP_Query orderby author__in
- How to orderby multiple meta fields if some fields are empty
- Sort wordpress custom posts based on meta value
- How to filter a query by multiple meta keys and order by other meta keys
- Multiple Orderby’s using random order WP_Query
- Debugging wp_query orderby for taxonomy
- WP Query – order posts by meta field first and then order the rest
- Order or Orderby in tax_query (How to define order of terms in WP_Query)
- Advanced WP_Query with meta_query, orderby?
- How to add custom meta to ‘pre_get_terms’?
- get term id from term name
- Order is breaking wp_query
- How to search for meta_query LIKE or tax_query LIKE and grab these posts on search results?
- WP_Query with multiple orderby NOT working with ASC and DESC, what’s wrong?
- Filtering by multiple conditions in the loop
- Orderby two meta fields not working
- Randomly select one of last 3 posts
- Tax_Query using WP_Query not working
- how to retrieve WP_Query without ordering by date [duplicate]
- orderby ignored by wp_query
- Can’t get term id for category archive
- How to make a post with certain taxonomy term display first before other post with only one query?
- Any quicker alternative for WP_Query “NOT IN”
- What’s wrong with this meta query? (order by meta key, then title, doesn’t work)
- Only show tag with the same id as the post
- display ACF repater field in archive page
- How to sort store location by specific category order in WP store locations
- Custom order of posts in wp_query and different taxonomies
- WP_Query random ordering not working since 5.4
- WordPress Query custom ordering by temporary variable
- Get categories within specific term
- Order by meta date with a thousanth of a second defaults to post order
- How to get_comments() ordered by date and parent?
- WP Query. Ordering posts by another post types meta
- WordPress tax_query ignoring relation OR
- Best way to query posts and order by relevancy to query
- wp_query sorting – one specific meta_key value at last and then sort by create date
- display all posts from category with and without terms in chronological order
- query_posts based on a meta_key
- In Product Category archives how to show Posts having same/similar prod_cat slug structure?
- Order posts by more than one variable (meta_key and publish date AND time)
- How can I get all the posts that are related with a specific taxonomy term?
- Create custom order sortby based on array of id
- How to combine nested tax_query logic with other nested query logic?
- tax_query not working for taxonomy slug
- Extending WP Query: Custom geolocation meta values work, but tax_query breaks
- Sort by meta key within same day
- Order Custom Field by Price
- Add a custom variable to query page object
- Show sticky post before other WP_Query
- Order by multiple meta keys on wordpress
- Tax query array terms display out of order
- Output ACF field dynamicaly within a taxonomy loop [closed]
- query only direct child and sub-terms of a current term archive
- Get access to all terms associated to each post that the wp_query loop displays
- Custom query for certain post type OR another post type with a certain category
- Can I use WP_Query to find a post with a particular menu_order?
- How to put posts with some taxonomy on top of others in `pre_get_posts`
- WP_Query sort by ACF date field (newest first) with blank dates first
- taxonomy-{term}.php terms pagination returning 404 after a certain page