Changing my query to following worked for me.
I removed the product ID field & called the post taxonomy directly as I didn’t need the product Id’s.
<?php
$args = array(
'post_type' => 'colorshades',
'fields' => 'ids',
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => 'colors_product_id',
// 'value' => $product->id,
// 'compare' => '=',
),
),
'tax_query' => array(
array(
'taxonomy' => 'shade_type',
'field' => 'slug',
'terms' => 'dcm'
)
)
);
$query = new WP_Query($args);
Related Posts:
- showing all search result in one template
- WordPress tax_query “and” operator not functioning as desired
- Custom taxonomy query broken after upgrade to 4.4
- Show posts without term
- WP_Query: Exclude hidden products from WooCommerce product list
- How to add taxonomy filter on the query fly?
- How to query only for products with status “in stock” in WooCommerce? [closed]
- Query WooCommerce orders where meta data does not exist
- WP_Query for WooCommerce Products
- Display posts the match taxonomy term linked from wp_list_categoies?
- Query two taxonomies via URL or link?
- Changing a theme’s search function to only show results from woocommerce?
- Get WooCommerce best selling products for the current month [closed]
- Counting number of posts with Category B in Category A
- Woocommerce query by price range and custom meta key
- Custom archive page based on array of categories and tags
- WP_Query | Help me create a search term with an ‘OR’ relation?
- Select posts wich has no relationship in custom taxonomy
- WooCommerce: filter by parent product’s taxonomy and product variation’s meta data
- Retrieve products with specific attribute and in category – woocommerce
- How to combine tax_query and date_query in WordPress
- how to retrieve specific product attribute value in an sql query?
- List taxonomy terms plus their latest post ordered by post date
- Querying by taxonomy vs Querying by Custom fields Speed Comparison
- Find all product that contain terms with %keywords% in WP_Query
- Display featured products through custom loop in WooCommerce 3 [closed]
- Filter and list posts of a custom taxonomy
- WP Query – Get WooCommerce Products with variation that is in stock
- How to show only one post for each categories of taxonomy of custom post that contains a specific custom field
- tax_query shows no results if nothing is selected
- Search product by brand name in wp_query
- Get product list of given category
- How to Modify Taxonomy Archive Page with Search Parameter?
- Get array of current post term ID’s
- How to exclude products by tag from woocommerce shop page?
- Setup of taxonomy term template pages
- Display link to taxonomy archive only if it has posts with certain custom field values
- How to do a query on custom taxonomies that is uncategorised?
- WooCommerce Only OnSale Products Loop Snippet [closed]
- WP_Query, tax_query and term_meta: How to?
- Order taxonomy terms in alphabetical order
- Query Custom Post Type Order By Taxonomy Field
- How to get the WC_Product Object when using a WP_Query in WooCommerce
- Extending woocommerce admin product search
- Query post from all category with same tag on 1 pages
- Query with custom taxonomy not working
- merge two query arguments into one WP_Query call
- Woocommerce returns Product post_status as published even tho it is in status draft
- Function get_queried_object() return NULL in custom taxonomy
- Getting Taxonomy inside WP_Query Loop
- WC displaying products from category
- Order posts by taxonomy count
- Querying on multiple taxonomies pulled from $_GET checkbox array not working?
- List custom taxonomy terms sharing posts with a term from a second custom taxonomy
- Get all products which have both product category
- Query custom post type by custom taxonomy (category slug)
- How to Filter Posts by Custom Fields?
- Woocommerce query all products and categories
- Take all produts by category
- Sort by price woocommerce by ID post_meta
- How to get all product attributes for filters in WooCommerce?
- Cluster WooCommerce products in each Category Archive by Tags assigned to products
- WP_QUERY to display woocommerce products whose author IS the logged in user
- Show posts from a custom taxonomy on a page
- Extend product search with meta in WooCommerce
- WooCommerce – get product sub categories
- WP_Query ignoring tax_query when is_singular
- Having trouble with WooCommerce Storefront child theme single.php “related posts” modification [closed]
- How do I exclude the lowest level terms in a taxonomy?
- wp_query for multiple cities (multiple values in a metabox)
- Woocommerce – Changing the order of the upsell products [closed]
- Out Of memory issue on post per page parameter
- WordPress query with items from more than one selfdefined taxonomy as `term` argument
- Query with relation and one without relation using multiple taxonomies?
- How to display an other custom post type in a different custom post type’s archive?
- Search form not working with custom query?
- Post loop for all taxonomy terms
- Display custom tags on pages that have a specific page parent
- wp_query args adding muitiple tax_querys
- Hiding taxonomies with no children WP_Query & tax_query
- find posts that don’t have a custom taxonomy
- Custom taxonomy.php not working
- wp_query not working with post_type
- Woocommerce – exclude only older out-of-stock items
- Filter Custom Taxonomy Posts
- Need Sub-category with main Category
- Woocommerce pagination and result count after custom loop
- WP_Query args to show posts from specific custom taxonomy
- WP_Query for a taxonomy with different taxonomy types
- How to query woocommerce product by pricing? [closed]
- get all posts associated with a custom taxonomy
- How to set an alternate posts_per_page value for default queries in different templates
- How to order WP_Query to group results?
- Using custom taxonomies in a query
- How to add custom meta to ‘pre_get_terms’?
- Tax Query only returns for the first of several terms
- get term id from term name
- WP_Query to output chosen term and posts with no term assigned
- Redirect Search to Form When No Product Results Are Found
- WP Job Manager plugin – Listing only the twelve job categories on frontpage order by jobs they have