You’re close, syntax is just slightly off. I can’t quite work out how/what terms you need to query for, but this should be the structure of your arguments:
$query = new WP_Query(
array(
'post_type' => 'product',
'orderby' => 'name',
'order' => 'ASC',
'tax_query' => array(
array(
'taxonomy' => 'product_cat',
'field' => 'term_id',
'terms' => $ids_of_product_cat_terms,
),
array(
'taxonomy' => 'product_brand',
'field' => 'term_id',
'terms' => $ids_of_product_brand_terms,
),
),
)
);
Read up on tax queries from the codex.
Related Posts:
- Exclude a term of a taxonomy with a custom post type in a search
- How to display product subcategories into my custom post type single page
- Get Terms from Custom Taxonomy and Current Post
- WooCommerce – Custom related product (Spareparts)
- Custom Taxonomy not working front side Woocommerce
- Custom Taxonomy is disabled on Edit page
- Complex strcuture as CPT or taxonomy for use in woocommerce product variations [closed]
- How to manage a bookstore
- Issue On Listing Woocommerce Parent Tag List
- Remove slug in taxonomy url
- Pagination throws 404 error on custom taxonomy archive pages
- Select All in Parent Category, Group by Child Category?
- Registering custom taxonomy with unique name, a good practise?
- custom post type and custom taxonomy permalink
- get_query_var() not working in pre_get_posts
- When we register a custom taxonomy or post type, does the WP database modified at all?
- How do I create multiple post types in same menu section in WP-admin?
- How to Programically add to the new WordPress menus
- Is it possible to have an index page for taxonomy term for each custom post type it is assigned to?
- WordPress Search documentation: how to improve search query using taxonomy terms, custom meta fields?
- What order? register_taxonomy() register_taxonomy_for_object_type() register_post_type()
- Remove base slug in CPT & CT, use CT in permalink
- Query for posts from any post type but only add instock products
- WooCommerce – Show orders for a specific product ? [closed]
- Function like in_category for custom taxonomies
- Add the .html extension to custom post types
- Dynamically create/remove terms in taxonomy when custom post type is published/trashed
- After deleting a post are terms, and custom meta deleted?
- Show metabox in custom-post-template depending on taxonomy term?
- Show Post Count of a Category
- Adding the taxonomy before the custom post type
- Menu Multiple Taxonomies
- Add Tags to custom post type
- Custom Taxonomy term archive template
- Custom page template for category taxonomy
- Permalink Structure CPT With Custom Taxonomy Fails
- Only show posts from a certain category?
- WordPress as Wishlist Application
- How do I create filters for custom post types?
- get_object_taxonomies() returns empty array for custom post type
- Display all posts in main category and 1 subcategory
- Search Custom Post Type & Taxonomies
- How to hook custom taxonomies to custom post types and make the permalinks work?
- Help need making decision. Ads rotating site on wordpress
- Categories of custom taxonomy don’t show any posts
- Displaying CPT and custom taxonomy side by side in Bootstrap 4 component
- Use Custom Post Type archive page for the taxonomies term archive page
- Is it possible to have dedicated page for parent/child taxonomy?
- Can a Custom Taxonomy be named “category” like normal Posts?
- How to use terms from the same custom taxonomy in different roles in a custom post type?
- How to have the same url structure for both a CPT and a Taxonomy?
- How to create custom url structure based on custom post type rewrite slug, taxonomy and category slug?
- Nested Custom Post Type or Custom Post Type Parents?
- limit value taxonomy based on previous taxonomy value wordpress
- Hide a widget inside a div on specific type of post
- Custom post type, permalinks, taxonomies and blog posts
- Deleting taxonomy terms and relationships on a custom post_type when a user is deleted
- Display related custom taxonomy posts in sidebar
- How can I get this request to use the Custom Post Type page template instead?
- Include custom taxonomy term in search
- Different slug taxonomy for two different CPT
- custom post type and custom taxonomy
- Why does my taxonomy have a category style div id?
- Get custom post type categories to show up in menus
- Display a post from custom post type only if all the selected taxonomies and custom field value matches the record
- Hide custom post type from search based on custom taxonomy
- Custom Post type date archive for custom taxonomy
- How to loop through custom taxonomies and sub taxonomies and display posts?
- WordPress custom permalink and archive link for custom post type
- How to populate a Gravity Forms Custom Post Field (dropdown type) with custom taxonomy terms? [closed]
- Building a Portfolio and need some direction
- Correct way of adding taxonomy to a custom post type
- Query Custom Post Type by Taxonomy
- Multiple custom post type queries causing wrong post types to be grabbed in taxonomy + single templates?
- How do I disable the built-in editor and automatically configure the properties of new pages?
- Change dynamically the dropdown list value
- CPT UI: Connect a custom post type to a custom post type
- List posts of custom post type under category name
- WP Query tax_query not returning posts
- How to show terms used only for particular custom post type. Filter creation perpose
- How should i name the .php file to show custom posts under a taxonomy’s term?
- What’s the most efficient way to get two queries based on an if statement?
- Form to custom post type and custom taxonomy
- Displaying custom posts in categories
- Best approach to allow front-end display of posts’ reviewers?
- Query pulling all taxonomies, not one I am specifying
- Custom Post Type rewrite url to /category/pagetitle [duplicate]
- Custom Post Type Taxonomy – Permalinks generating, but posts not found
- template structure for CPT not clear
- Trouble showing showing Posts related to custom post type and taxonomy.
- Post Editor: display categories from current post type taxonomy only?
- Generating List of Tags from Custom Post Type
- Exclude a custom category from a list
- Add 2 Taxonomies to Custom Post
- Custom Taxonomy in Permalink from post type
- How to add taxonomy in menus?
- WordPress and Unity high scores table
- update custom taxonomy with Ajax in edit.php file [duplicate]
- Separating a custom taxonomy from blog post-type
- Custom Taxonomy Tags and Category using same slug