I have the similar query in my blog. This my args array :
$args= array(
'post_type' => 'box',
'posts_per_page' => -1,
'meta_key' => 'position',
'order' => 'DESC',
'orderby' => 'meta_value_num',
'tax_query' =>
array(
array(
'taxonomy' => 'taxonomyname',
'field' => 'slug',
'terms' => 'yourterm'
)
)
);
Hope it will help you
Related Posts:
- How do I query for posts by partial meta key?
- Display products from specific category in shop page
- How to uniquely identify queries?
- meta_query where value is equal to given value
- Query by meta_key and order by meta_value_num return orderby date
- How to display most recent posts that haven’t already been displayed with WP_Query?
- What is the difference between these two custom queries?
- WP Query post meta value
- Display featured products through custom loop in WooCommerce 3 [closed]
- Understanding the use of wp_reset_query();
- How to exclude products by tag from woocommerce shop page?
- Filtering posts by custom field value not working
- Multiple WP_Query loops with Pagination Not Working
- WordPress posts per page WP_Query
- WordPress WP_Query orderby being overwritten
- Multiple meta queries but arrange by specific meta value order
- Custom pagination with WP_Query generating 404 error
- WooCommerce Only OnSale Products Loop Snippet [closed]
- Query post with meta_query where date is not in future
- Apply CSS class to every second database record [closed]
- WP_Query date_query – Use unix timestamp?
- pre_get_posts order by not working
- WP_Query last five posts, simply ordered by meta_value
- How to display specific posts with WP_Query?
- How do I change the order (ASC and DESC) in the following retrieval method using WP_Query?
- What is the random string I am seeing when I use get_query_var?
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- How to get all child pages in their parent page?
- WP_Query order result by date AND meta_value
- How to display summary content from a Page (Not a Post) on another page
- Custom Search Not Consistent with Results
- how do we display all posts from a particular category in homepage?
- Display both standard posts in a specific category along with a custom post type in a single loop?
- Orderby is working with one query but not with other
- meta_query in WP_Query value is not accepting array
- Is there a way to work with a specific the_field from an already queried post? [closed]
- Add capabilities via plugin for another plugin
- Two loops on archive page
- How to order posts by title after they have already been sorted by category
- Filter and Order by Multiple Custom Meta Values
- Meta Query relation “AND” then set array accordingly
- How to query custom post types with mixed AND & OR statements for custom fields
- Query with meta_query and tax_query together not working properly
- Adding a tax_query to a WP_Query Object
- wp_query search not taking keywords with together for multiple words
- Adding a html class based on post count
- meta_query fails to compare on values containing apostrophes
- Set front_page programatically after user login via query, while leaving site option alone
- How I can change the condition or compare operator for WP_Query in pre_get_posts
- How to Display Shortcode in the correct location, currently displaying before content after Page Title?
- Filtering posts by archive showing all years
- WP_Query posts_per_page strange caching
- wp_query show all values
- Why having more than 10 clauses in WP_Query results in some outputs being dropped?
- mysql query order by
- Hiding carousel indicators if there’s only one post
- add_query_arg to compare and display events from a certain date
- WordPress dynamic AJAX query
- Custom Taxonomy Breaks Pages
- Using rewind_posts for displaying multiple categories
- Query to get last posts from authors of blog
- WP_QUERY tax_query not working
- How to get latest post excerpt from a specific category?
- WP Query get only 1 post (sticky, not sticky etc)
- WP_Query not returning correct result with meta_query parameter
- Order post by modified date
- Redirect logged in users from a custom post type archive page if they don’t have a specific role
- Custom query to retrieve oldest post and retrieve others with date interval
- Custom order revolution sliders post base slides as inserted in Specific Posts List field
- How to display Woocommerce products list by tag
- Display the search results like the original pages
- Order 2 meta_queries differently in WP_Query?
- Unable to reset post data in wordpress custom query
- Check the product in the cart from which category is and show message
- How to filter on placeholder image
- Slow wp_posts and wp_postmeta query using Advance Custom Fields
- WP query for two post types how to order newest to oldest with two different meta fields?
- Get posts with any value in attribute
- WP_Query & shortcode : Return 3 articles from a category WordPress
- how to get dynamic data on wordpress from codeigniter?
- WP_Query doesn’t works inside loop
- Rewrite rule pagination on different url levels
- Pagination in WP_Query?
- 2 Loops on one page – pagination of 2nd loop ignore array of excluded posts
- WordPress Prevent 404 on missing custom post
- return wp query results in a shortcode
- Custom query to order by multiple taxonomies
- How to add archives (with pagination) to page template?
- Custom WP_Query with SQL directives for getting posts by authors and terms
- No content found on page 2 of pagination with 1 post per page
- confirm my booking with phone number
- pre_get_posts redirecting
- Showing posts from 4 categories along with all latest posts
- Creating Custom Query
- Searching in specific custom post type
- Hook to get the query result after listing posts
- WP Query – Show custom posts only if user contain some user meta
- How do I subquery with custom meta fields?
- Show number of posts AND number on current page (cannot make it work)
- Advanced Search – Is this possible?