Unfortunately, WordPress doesn’t have a built-in way to sort by taxonomy term. You do, though, have a couple of options.
-
You can iterate through your taxonomy terms and run a separate wp_query for each as this post shows.
-
You can directly manipulate the SQL query to achieve what you want. This article shows how. Look particularly at the last, Direct JOINs method.
Related Posts:
- How to sort a WP_Query array by post_name after an array_merge();
- Sort Posts with custom meta key by default which is currently set as optional
- Ignoring initial articles (like ‘a’, ‘an’ or ‘the’) when sorting queries?
- Sorting: custom query with orderby meta_value_num THEN by title
- Sort posts by category name and title
- Too slow when using both ‘tax_query’ and ‘meta_query’ both in WP_Query
- How to get Page/Post Gallery attachment images in order they are set in backend using WP_Query()?
- How can I save an array from a random post sequence for later use?
- Loop through all tags & output posts in alphabetical list
- assign 2 $args to one wp_query
- Sorting Posts by custom field
- Sorting meta_value as integer doesn’t work
- WP Meta Query for some meta (array) values
- meta_query with array as value
- Sort in WP_Query(), not filter? Is it possible?
- Show one post per author and limit query to 8 posts
- Front End Sorting Questions
- Woocommerce custom loop to show all the products [closed]
- Sort by meta key on archive page
- How to sort posts in admin by titles with dd.mm.yyyy format?
- How add a custom posttype name using ACF field to a query post array
- How to make orderby ‘meta_value_num’ OPTIONAL?
- Meta query with order by another custom field
- How can I get an array of all IDs from the current queried object?
- WP Query for variable taxonomies
- How do I sort posts with multiple pages
- Minimize database queries to user tables?
- WP_Query posts by distance based on LAT & LNG in Database
- Changing WP_Query params with url Query Var
- (Solved) WP_Query ($ args) -> How to sort letters and numbers within the same array
- Adding an array from a query string to a WP meta_query
- Sort wordpress custom posts based on meta value
- WP_Query: Group events by year, sorted DESC; then by date for each year group, sorted ASC
- WordPress Comments sort by custom meta key
- Understanding the orderby in WP_Query?
- How to list custom fields as headers and list all pages sharing that custom field under it?
- WP_query sorting can’t sort danish letters (æ, ø, å)
- Help ordering Post loop by two meta values
- How to sort a custom wordpress query by combination of meta values?
- Gallery shortcode numerical sorting
- Sort WordPress Posts Meta value by Week not Day
- Removing duplicate values between two wordpress queries
- Combine results of multiple WP_Query to resemble single WP_Query
- How to order WP_Query to group results?
- I am having problem sorting custom post type using WP_Query
- Does meta_value (array) work with ‘orderby’?
- Sorting search results with custom dropdown
- How to use a dropdown to filter posts by custom field
- How can I comment comma-separated array values?
- Display all posts in a custom post type, grouped by a custom taxonomy. How to sort the posts alphabetically and the terms by ID?
- How do I add a relation parameter to my filter query?
- How do I sort this custom list of sticky posts
- WP_Query with page_ids in arguments without a result
- Related Posts Excluding Certain Categories
- Query using string from custom field as array value
- Multiple meta query from array
- Category based on post id
- How to avoid filling up an array each time I run a WP_query?
- How to sort queried pages by an array of page ids?
- meta_query returning excluded result
- orderby ignored by wp_query
- Customize the Sorting Dropdown in WooCommerce use another list or more page
- Order (by ASC) posts with meta_key so posts without values are last
- Combine relationship posts with existing wp_query
- How to sort store location by specific category order in WP store locations
- Counting instances of words in the results of a post query
- how to include orderby value that is empty?
- How to sort wordpress posts already selected by WP_QUERY
- Sort by price wpdb
- WP Query by 4 different taxonomies
- Trouble with serialized metadata
- How sort products by calculate value? ( custom post meta, price, option)
- Get authors list and sort them by recent posts
- What code to use in an array to call the current sub-category?
- Order by value of Custom Field using url string
- WP Query with meta queries
- Case insensitive ORDERBY in wpquery
- Sort posts on custom field AND after that sort on date?
- How to mix two orderby-parameters into one ordered result
- Repeat array inside array through while loop
- Related Post by Tags Code
- Ignoring ‘a’ when sorting posts
- date_query problem
- Display three sequential posts on each page load, without repeating previous
- Combine WP_Query with array of custom data to single loop without breaking the pagination
- WP_Query: Meta_Query with serialized value (or a workaround)
- wp_query – Modify $query to include duplicate content
- How to get several fields from wp_query?
- Sorting is not working in WordPress WP_Query
- Issue with WP_Query (need a array of selected ID’s)
- WordPress WP_Query Array Custom search via taxonomies
- WP Query posts__in not working with array
- query_posts with sorting on a custom datestamp
- wordpress sorting using array merge by price in ascending order but price with 0 must be show last
- have_posts order by title descending
- WP_Query – order with usort by custom meta
- How do I have multiple metaqueries inside one wordpress query
- Orderby meta _value that is saved as an array
- How to `’orderby’ => ‘meta_value_num’` in a series of orderby parameters
- query loop “inherit query from template” prevents setting sort order