First, get all term slugs from the custom example taxonomy space by current post ID.
$space_terms = wp_get_post_terms( $post->ID, 'space' );
if( $space_terms ) {
$space_terms = array();
foreach( $space_terms as $term ) {
$space_terms[] = $term->slug;
}
}
You should specify the logical relationship between each inner taxonomy array when there is more than one.
The relation key in the array describes the relationship. Possible values are OR and AND.
'tax_query' => array(
'relation' => 'OR',
array(
'taxonomy' => 'department_categories',
'field' => 'slug',
'terms' => $course_terms,
),
array(
'taxonomy' => 'space',
'field' => 'slug',
'terms' => $space_terms,
),
),
Related Posts:
- List taxonomy / category count showing list published posts only
- Get pages only with a specific taxonomy
- Taxonomy archive showing no results
- Get taxonomy parent using child slug (from merged taxonomies)
- How to use tax_query other than by slug or id or solve custom taxonomy tags conflicts with pre-existing tags?
- Advanced AND tax_query in sidebar with 2 taxonomies
- wp_get_object_terms count on taxonomies within an category archive
- Using wp_query is it possible to orderby taxonomy?
- How to add images to taxonomies?
- Can you add the visual editor to the description field for custom taxonomies?
- custom post type taxonomy “tag” archive : no post found
- Get taxonomy names by post id
- Return only the custom sub-term for custom post type, do not echo term-parent
- Get total number of comments from posts in a specific custom taxonomy
- Check if current term is a child of another term
- Custom hierarchal taxonomy loses interface hierarchy when selecting parent & children
- Formating the_terms() function output
- Using tax_query creates a 1 = 0 or 1 = 1 in $wp_query->request
- Custom taxonomy on users with UI
- Post tags saving as both tag name & tag ID on post update when tags are displayed as checkboxes
- Looping Through Custom Tax Terms and Displaying All Posts For Each
- Taxonomy Relationships
- How to get the top most term (top ancestor) of a custom taxonomy child term?
- tax_query not working on main query
- Combine multiple custom user taxonomy in single url
- Add custom taxonomy to default category taxonomy?
- Ordering Posts with Custom Taxonomy Terms Array
- Display sub-taxonomies based on SELECTED parent-taxonomy
- Checking if a Page has an Associated Term?
- What are terms and taxonomy, how they related to post and how these three are stored in database?
- Taxonomy , subtaxonomy,child taxonomy of a product woocommerce
- Get terms ordered by post date
- How can I get WP to build a feed based on multiple taxonomy terms
- pre_get_posts Tax Query not working for custom author page
- Change permalink of post if it belongs to custom taxonomy
- Share taxonomy between user and posts?
- ACF vs Taxonomies
- Reverse traversing taxonomy based on term_id
- How to filter terms from a custom taxonomy by a usermeta value on all screens and templates
- How to obtain the link/URL to the feed of a custom taxonomy?
- get_term_children doesn’t return an array of children terms
- Query Multiple Taxominies Across Multiple Post type’s
- ‘wp’ action hook not firing in admin and login?
- Use get_the_terms to list subcategories of custom taxonomy
- Custom taxonomy [year] is directing to yearly archive
- Display Taxonomy Terms in an option tag with value being the slug
- Modify “View” in admin panel for custom taxonomy
- Manipulate WP Query using a custom post type and multiple tax_query taxonomies
- Taxonomies on custom taxonomies
- Hide product categories and taxonomy terms in menu if empty
- Custom taxonomy forms for user profile
- How to add Post Format Taxonomy Archive page in the menu?
- Query posts by taxonomy with current term
- get the taxonomies terms associated with users
- Add Taxonomy Subcategory To Permalink
- problem in taxonomy-{taxonomy}.php pagination
- Create custom taxonomy and Display in metabox dropdown
- Custom Taxonomy with tax_query
- Get posts in certain Taxonomy terms for the current page url
- How to add images to taxonomy terms? [duplicate]
- Why get_page_template() doesn’t show taxonomy template file name?
- Trying to add taxonomy to get_categories() but it’s not working. How to fix this?
- Edit custom taxonomy description programatically
- Get taxonomy name for the current post
- View the complete list of a taxonomy in the navigation menu
- Get name of taxonomies of current page
- Filter through custom taxonomy with an array of taxonomy IDs
- How to get attached image to taxonomy..?
- How to get list of only custom taxonomies?
- Add custom taxonomy as a css class
- Taxonomy page shows category in title
- Query custom taxonomy for category including children
- Taxonomy Overview Page?
- Only display latest custom taxonomy post
- How can I get Taxonomy Images to work with ‘orderby’ argument?
- Unable to get the Parent Custom Taxonomy Terms
- How to combine taxonomies into URL?
- Amend taxonomy to search in wordpress admin
- Unique taxonomy for post
- Hi need update in my terms for other taxonomy
- Add terms to a taxonomy archive from within the same taxonomy
- Show recent posts from a custom taxonomy in wordpress
- Fill New Taxonomies
- add pagination in wordpress page template
- problem : Custom taxonomy template not showing
- Filter “get_terms” query
- How To Create Dynamic Permalink To Custom Taxonomy List of Current Posts?
- Dropdown (with onChange) with custom taxonomies
- tax_query not working?
- generate random slug when adding taxonomy
- How to use two same taxonomy in same post differently?
- Sort Taxonomy List by Custom Values
- How to display custom taxonomy
- Taxonomy term breadcrumb; how?
- Using wp_query is it possible to orderby taxonomy?
- Alternative for is_taxonomy() to workaround theme’s default sidebar
- Custom Taxonomy Template Variables Available?
- Adding new terms to custom taxonomy
- Group custom taxonomies based on tags contained in their posts
- Taxonomies starting with a hyphen (minus) to assign B.C. dates to a post