You will have to change your tax_query. The xs
is not the term_id
but the slug
So your tax_query will end up being like
'tax_query' => array(
array(
'taxonomy' => 'pa_sizes',
'field' => 'slug',
'terms' => 'xs'
)
)
I would love to help with the “instock” problem too, but I’m stuck with that question too.
Related Posts:
- Query WooCommerce orders where meta data does not exist
- WooCommerce: filter by parent product’s taxonomy and product variation’s meta data
- Extending woocommerce admin product search
- Extend product search with meta in WooCommerce
- Multiple meta_key ordering with pre_get_posts
- How to echo woocommerce category name
- ElasticPress is (aparently) messing with my search filters
- Woocommerce Get Orders By Meta Value
- WooCommerce WP_Query using tax_query returns no results (0 = 1)
- compare meta_query in get_posts arguments
- Display products from specific category in shop page
- Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
- Order by meta_value_num DESC and meta_value ASC on WP 4.0
- Query by meta_key and order by meta_value_num return orderby date
- Wp_query order by multiple custom fields?
- WordPress altering my custom query, How to fix it?
- Order by meta_key in custom post type doesn’t affect the query
- How to create/modfiy WP_Query to search in post title OR custom field?
- Display featured products through custom loop in WooCommerce 3 [closed]
- Advanced WP Query hogs the SQL server
- How to get user_id from wordpress database inside ajax function?
- Meta query with order by another custom field
- WP_Query with multiple meta fields filter?
- How to combine meta_query and post__in in WP_Query
- How to orderby meta_value_num with dollar ($) sign
- Output an array of terms for a ‘tax_query’ => array()
- Meta Query Array Error 500
- showing all search result in one template
- WP_Query Not Recognizing Taxonomy Parameter in Custom Search
- Take all produts by category
- How to get all product attributes for filters in WooCommerce?
- Fetch Record based on meta key dates
- Suggestions on making this query/code more performant
- WP Query Args – Title or Taxonomy Value
- Large AND OR query timing out
- meta_query not working as expected
- Slow WP_Query with ‘OR’ on meta_query
- How to filter a query by multiple meta keys and order by other meta keys
- Redirect to another page using contact form 7? [closed]
- Query posts with “non set” meta value
- Custom taxonomy.php not working
- Ordering a mysql style datetime stamp with meta_query
- Wp_query with 2 meta keys and array of meta values
- Advanced WP_Query with meta_query, orderby?
- meta_query: check if number exists
- How to order WP_Query to group results?
- Event with multiple dates, display events chronologically
- Get Child Category only
- WP_Query Taxonomy categories filtering
- Woo Commerce using WP_Query to get products that match price range, with an additional required product attribute
- WP_Query: apply an SQL function to meta fileld value
- Assign a minimum result count for WooCommerce query shortcodes?
- How to search for meta_query LIKE or tax_query LIKE and grab these posts on search results?
- How to create dynamic value in WP_Query meta_query
- WP Query / Meta Query [duplicate]
- Query posts by searching for a string in a meta field
- $wp_query->found_posts not returning correct value
- 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?
- Query multiple post types, but different order for each
- How to add date_query to meta_query array
- Order by the first array within a meta_query
- Query ACF relationship field – Comparator IN – Value array
- Use get_cat_ID to retreive multiple category IDs
- Combine query in WP_User_Query()
- Multiple nested meta queries
- How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields
- Make a products only viewable to a specific user ID in meta_query pre_get_posts
- How can I modify the query by adding to the existing query?
- Meta query ignores multiple values of the key
- WordPress Query custom ordering by temporary variable
- Check for not NULL not working in meta query
- Comparing Meta Field date in WPQuery using Meta_Query?
- What code to use in an array to call the current sub-category?
- Get categories within specific term
- WP_Query paginate with one term per page?
- How to create better WP_Query to look for date time which is anywhere between two meta values?
- Query against multiple locations within single custom post type post
- Filtering WP_Query based on wp_postmeta keys values
- Complex Meta Query
- Not able to fetch woocommerce variation sales products for particular category products
- Multiple meta_query not working
- compare for multiple meta values for same key in wp_query
- datetime picker, timestamps and meta queries
- WP_Query with meta_query won’t orderby
- meta_query only check if both value are set
- Taxonomy Terms That Don’t Exist Display Results
- Woocommerce WP_Query post__not_in problem
- WP Query with sticky posts and tax_query
- Extending WP Query: Custom geolocation meta values work, but tax_query breaks
- Using custom field as ‘orderby’ value causing post grouping by publish date
- Looking for a way to exclude frontpage and nav menu from query filter
- Creating Custom Query
- tax_query not working properly with get_posts
- Get posts by meta value except one post [closed]
- WP_Query by meta key not returning any posts
- How to get all post_id and meta_value using meta_key in wp_postmeta table
- WP Query – Show custom posts only if user contain some user meta
- How do I subquery with custom meta fields?
- How can I get taxonomy term name using term slug & post ID using build in WordPress function or class?