This should give you an OR
relationship:
$args['tax_query'] = array(
array(
'taxonomy' => 'category',
'field' => 'id',
'terms' => array(1,2),
'operator' => 'IN'
)
);
As would this:
$args['tax_query'] = array(
'relation' => 'OR',
array(
'taxonomy' => 'project-type',
'field' => 'id',
'terms' => array(1)
),
array(
'taxonomy' => 'project-type',
'field' => 'id',
'terms' => array(2)
)
);
Be aware that that will become increasingly inefficient as you add more terms. It should perform tolerably with just two. The first version is neater and probably performs better in general, unless you need to search by multiple taxonomies.
Related Posts:
- SQL to update custom post taxonomies
- Query multiple taxonomy in Custom Post Type
- Querying Posts by Taxonomy From Alternate Network Site
- Include different loop templates in search query
- WP_Query search posts by custom post type and custom taxonomy
- Is it possible to create a shortcode that will query a post based on taxonomies?
- Show Two custom Post type and their posts on category page
- How to filter custom taxonomy categories on archive?
- Querying Term Posts in Loop
- Am unable to reset a query properly
- Get next and previous 3 posts in a term in single post page
- Making certain categories of CPT not publicly queryable
- Search / Filter posts on Title/Content OR Tags
- Get parse_query filter to return slug instead of id
- How do I move/order posts with a tag to the end?
- Specific query for custom post type
- Display post content with respect to its title?
- First custom field value (out of several) displayed twice after query
- WP_Query orderby and tax_query
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- WP_Query() with custom post type and taxonomy — get all terms?
- Can I query posts by taxonomy conditionally based on post type?
- Query not work for current taxonomy
- Display a post from custom post type only if all the selected taxonomies and custom field value matches the record
- Custom Post Type not showing in main loop
- Custom taxonomy query showing more than 4 posts
- Custom types, taxonomies and query optimization
- Query custom posts from custom taxonomy
- How to divide Subcategories into pages of parent category wordpress
- Check that a slug is present in the get_terms request
- Is there a way to use ‘publicly_queryable’ => false only on specific taxonomy term?
- Displaying all posts by category and showing content on click
- WP_Query for custom taxonomies showing posts from non-specified terms?
- How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
- Get posts of an specific term of a custom taxonomy
- Query Pulling the same post twice
- Query Only Show Text on Posts With Certain Taxonomy Tag
- how to limit query_post to first page?
- Listing custom post type items from a couple of custom taxonomies
- Exclude a category from WP_Query
- Check if post type has term
- How do I Filter Custom Post Type by Custom Taxonomy in the newest WordPress RESTful API?
- Query custom post type by custom field
- Custom taxonomy not showing up when adding a new custom post type
- WordPress custom taxonomy URL rewrite on spelling errors
- TV Show database – Best way for structuring it?
- Rewrite permalinks for custom posttype and custom taxonomy
- How to check if last uri segment is a custom post type or taxonomy term?
- Query posts by custom post type and custom taxonomy
- Sort the main query in subcategories/terms?
- Highlight nav menu terms
- Custom Post Types, Custom Taxonomies and Permalinks ?
- Display Custom Category (taxonomy) Name in Custom Post Type
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- removing custom tax & CPT slug, adding taxonomy term in front of custom type
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- Custom Post Types relationships
- How can i skip same post from taxonomy term?
- Set menu active state for custom posttype and category, given custom taxonomy term
- Getting a PHP Notice when using Pods with WPML [closed]
- Custom post type structure for posts with multiple child posts
- Extending AZIndex plugin to use custom post types and custom taxonomies
- How to display custom taxonomies with links in filter menu?
- List custom taxonomy specific to one custom post type
- Hide parent categories when clicked, and show it’s childs
- Get unique superset of taxonomy terms from a list of custom posts in another hierarchical taxonomy
- Auto Complete Search
- permalink /category/post-name with custom post type and taxonomy
- Custom post type Permalinks with hierarchical Taxonomies
- Can’t use pagination with custom taxonomy
- Hide specific taxonomies from a taxonomy list using ‘get_object_taxonomies’
- Targeting categories in custom fields
- Displaying tags associated with posts in Custom Post Type
- Custom taxonomy page returns 404
- Targeting custom post type via functions.php doesn’t work
- How to define the template for custom posts?
- Multiple archives to display parent and subcategories content
- How to List Custom Post Type Titles Based on Theirs Taxonomy Terms Inside a Nested Loop
- Get newest created custom category (get_term_by and variables) (outside Loop)
- Custom Taxonomy Taxonomies of Same Name point to first created URL
- Taxonomy terms with the same name are updated between separate custom post types
- Add custom post type to query
- Custom taxonomy permalink without term, redirection to CPT slug
- Display post count for a specific month
- Create custom post type categories
- Add other all taxonomies as meta boxes to custom post type
- How to get post type archive category title
- Remove CPT Slug with 2 taxonomies and 1 post meta
- URL with Hierarchical Taxonomies and same slug for all terms and sub-terms
- Custom post type archive page not showing on archive-posttype.php
- Should I make a taxonomy to organize data like this?
- Display Custom taxonomy, Child terms and posts in a template Under Specific Parent terms
- List all posts from custom post type by taxonomy
- Sort a custom post type loop by a custom taxomomy instead of chronologically
- changing post type in loop query
- Taxonomy and Rewrite Structure
- Add custom taxonomies as class names to an archive page of custom post types
- Custom Post Type Base URL
- Filtering custom post types using category taxonomy
- How to use wp_set_object_terms depending on page ID?