If you look at the documentation for WP_Query taxonomy parameters, you’ll see that the tax_query is an array of arrays.
So:
'tax_query' => array(
array(
'taxonomy' => 'product-type',
'terms' => array('software'),
'field' => 'slug'
)
)
Related Posts:
- The Operator “NOT IN” Does Not Work In tax_query
- Sorting a list of posts displayed under a list of associated terms (which should be sorted without initial articles)
- How to display Related Posts based on number of taxonomy terms matched
- WP_query – Filter by tax_query and meta_query using multiple select
- WP_Query parameter conflict
- Custom Category Walker with Image, Fallback to Most Recent Post in Category Image
- tax_query (if the terms are empty)
- custom post type and a “sticky” position taxonomy
- How to search through all child taxonomies using WP_Query?
- WP Query tax_query not returning posts
- tax_query showing no results
- WP Query Conditionally query meta and taxonomy
- Display all posts in a custom post type, grouped by a custom taxonomy
- Exclude a category from WP_Query
- Select All in Parent Category, Group by Child Category?
- query multiple taxonomies
- Custom Taxonomy with Custom Post Type Finds No Posts
- Custom query – alternate posts by category
- WP_Query -> sort results by relevance (= most tags / taxonomy terms in common)
- how to group custom post type posts by custom taxonomy terms
- Sort the main query in subcategories/terms?
- Custom Taxonomy List links being re-written
- Want to filter only parent post in admin area
- Multiple Archive Pages for Custom Post Types AND Taxonomies
- Exclude current post when getting related post on custom post type and taxonomy
- Display Posts of a Category in Alphabetical Order (Custom Post Type)
- Ordering Custom Post Types with WP_Query
- Custom post query by taxonomy
- Querying CPT with Two Taxonomies
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- Custom Query to display posts with custom field
- Get taxonomy description based on variable
- Show Post Count of a Category
- Querying Term Posts in Loop
- Group custom posts by custom taxonomy names
- How can i skip same post from taxonomy term?
- Filter by custom taxonomy slug on a custom post type
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- Pagination : How to remove /page/x/ after a ‘POST’ action on a form returning to page 1
- Query custom post type by category slug
- Archive for custom taxonomy lists all posts instead of current taxonomy
- wp_query check if integer exists in custom field’s array
- Wrong request query on cpt and tax
- Search / Filter posts on Title/Content OR Tags
- WP_Query most viewed posts, in multiple Post Types, last 30 days, excluding a specific taxonomy term
- Custom-Posttype & Custom Taxonomy WP_Query
- How to Filter custom post type by taxonomy?
- Custom taxonomy rewrite give pagination 404
- WordPress loop: Show only a Custom Post Type Taxononmy TERM
- What’s the WP way to load remaining custom posts?
- Custom Widget WP_Query problem
- How do I display the grand child items of a taxonomy term?
- Query Custom Post Type Taxonomy term with multiple parameters
- Advanced search form with filters for custom taxonomies
- Retrieve custom post types by custom taxonomies with WP_Query
- WP the_posts() on single-cars.php get category link
- Custom Taxonomy Not Showing in Front-End When Outputting a Custom Post Type with WP_Query()
- Using page slug in wp_query
- Custom taxonomy wp_query woes.
- Creating two loops based on different logic
- Different options per post type in WP_Query
- How to show all taxonomies within custom post type loop
- How to query Posts from a custom post type which contains a custom taxonomy?
- Query Posts that have Custom Taxonomy
- List all Custom Post Type posts excluding certain Taxnomy term
- Foreach loop returning more than one item when querying taxonomy
- Loop for custom-post-type comparing taxonomy terms for “related” posts?
- Multiple custom post type queries causing wrong post types to be grabbed in taxonomy + single templates?
- Sorting the Loop by Taxonomy Value
- “Menu order” being ignored when querying posts from a parent taxonomy with “include_children” set to true
- Custom Query: Multiple CPTs and a taxonomy filter
- custom taxonomy pagination 404 error
- Ordering by meta value not working
- Display post count for a specific month
- WP_Query to display number of custom post type filtered (order by) taxonomy
- WP_Query for custom taxonomies showing posts from non-specified terms?
- Live search by custom tag
- Query a custom taxonomy in a function to create an csv file
- Custom search for a custom post type in WordPress
- Ajax load more inside custom post type taxonomy
- How can I get the last 5 element of this tax query?
- Create a custom wp_query from a specific custom post type with specific taxonomy
- Displaying WordPress posts from post and custom post type in custom taxonomy
- Display all Custom taxonomy terms and their relevant custom posts
- Query pulling all taxonomies, not one I am specifying
- Query breaking with ‘posts_per_page’ => -1
- CPT Efficient way to display posts from different categories with custom query
- Query Pulling the same post twice
- Get posts associated with custom taxonomy alternate way
- Loop with Custom Post Type and Taxonomies
- Values inside a custom field to determine which category posts to display
- How to display elements of different post types?
- Cannot query custom post type taxonomy from theme options array
- Listing all custom post types using a specific term on the said term’s template page, in groups
- Using tax_query to get single post per category
- Attaching multiple custom taxonomies to one CPT?
- Get X posts with the same terms as the current post (custom post type and custom taxonomy)
- Sort ACF by custom taxonomy
- Query custom post type and group by taxonomy
- Dynamically count the number of custom post types associated to a custom taxonomy