You use multiple taxonomies at once, so use'relation' => 'AND'
:
<?php
$args = array(
'posts_per_page' => -1,
'post_type' => 'products',
'post_status' => 'publish',
'tax_query' => array(
'relation' => 'AND', // this is what was missing
array(
'taxonomy' => 'subjects',
'field' => 'name',
'terms' => $shortcode_atts['subject'],
),
array(
'taxonomy' => 'plans',
'field' => 'name',
'terms' => $shortcode_atts['plan'],
),
),
);
Related Posts:
- Show ACF field from custom taxonomy and display on the single template
- Custom front-end form for adding post – Category problem
- Getting custom taxonomy from custom post type
- Meta Query “IN” doesn’t work with ACF checkbox filter
- Ajax filter with custom taxonomies
- List events by month
- Filter posts with ajax form and checkboxes
- get terms that have post with custom post type between 2 values
- How to get only one category of custom post type?
- Get all taxonomies for all post types
- Append taxonomy terms as class names in markup?
- Change message given when deleting post from custom post type
- Building an Advanced Search (text, tags, category, custom fields) – Getting the wrong SQL query
- Linking three taxonomies with ACF
- List terms from Custom Taxonomy
- WP_Query search posts by custom post type and custom taxonomy
- Link users to a custom post type
- How to output wordpress custom tags separated by comma?
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- How to retrieve category NAME instead of ID in a function with a taxonomy custom field?
- Weird problem happening with custom taxonmy when creating/updating posts
- Taxonomy Archive: Display only one post per term from separate custom taxonomy
- How to display Custom Post Type Post based on Tag with Shortcode Parameter?
- How to display selected taxonomies by their parent
- Custom Field Order by Last Name and First Name
- Retrieve value of a category’s custom field
- Get custom post type list for every category shortcode
- Custom Taxonomy terms aren’t getting referenced or saved in Quick Edit or Bulk Edit, only on Single product page?
- WP_Query to select custom post type with Advanced Custom Fields (ACF) date
- 404 error when navigating to a taxonomy page with Cyrillic, what’s wrong?
- Query Custom Post Type Taxonomy term with multiple parameters
- Lists custom taxonomy terms that has specific custom field value assigned to the term (not post)
- How to update post meta on uploaded image from a custom form?
- How to group posts and get a mixed posts and groups view?
- Different Category system needed for the Custom Post Type
- Trying to get custom post of a custom taxonomy
- Control content before and after custom post type loop
- Different options per post type in WP_Query
- Creating a non-hierarchical Taxonomy that behaves like categories
- When I choose category from dropdown then everything working fine.But in backend it checked only child not parent [closed]
- Query custom post types & Taxonomies and list them in a table on a page
- Custom post type and custom taxonomy 404 on page 2
- Nested Custom Taxonomies | Incorrect posts when querying
- meta query not retrieving posts
- Commas not displaying in implode
- add custom tags for custom post type in wordpress
- Get A Custom Field From A Custom Taxonomy Of A Custom Post Type [closed]
- Displaying One Custom Post Type’s Content On Single Post of Another Custom Post Type
- Function to erase every post from a taxonomy
- Using page title as a link to term archive
- Setup page template array in a custom post type
- How do I ensure that post_type and Taxonomy use the same slug?
- How to get post count of specific taxonomy that have store name & category
- Fetch data from two custom post types and create multidimensional array for output to html table
- Create a Dropdown Selector and Redirect for a Custom Taxonomy in WordPress?
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- ACF – Retrieve custom taxonomy from a relationship field
- set object terms after some some time of published post – functions.php
- Create loop from selected terms in ACF taxonomy field
- update custom taxonomy custom fields
- Filter taxonomy by CPT
- Sort custom posts by date and then by taxonomy
- Display Custom Field or Custom Taxonomy in front page /post/product
- WP_Query not using custom taxonomy categories on custom post type
- If ACF Post Object post has custom taxonomy term…
- Some posts not displaying by taxonomy term
- Taxonomies are not showing in the category dropdown
- Combine multiple separate lists into one
- Taxonomy shows up twice on Custom Post Type
- Filter Custom Post Type Posts by Taxonomy
- Change Search display for Custom Post Type
- Custom search for a custom post type in WordPress
- Custom Taxonomy – fields
- Display custom tax in “while” loop
- tax_query not working?
- Add active class to foundation 6 tabs while looping categories
- WordPress query posts by custom post type not workng
- Show custom taxonomy not in submenu
- Can’t pick up a field created with Advanced Custom Fields
- Pods pagination erases my sub menu
- Create 2-layered dropdown menus for custom taxonomy and custom post type
- Custom post tag images not displaying with ACF
- Get month and day from a Date Picker custom field
- How to query posts by meta keys AND under specific category?
- Exclude Custom Post Type from shared Custom Taxonomy
- Show Custom Post Type taxonomy term that matches custom field
- WordPress Custom Post Type and sort by Tags
- using ACF datepicker to filter posts on a page
- Order by custom field attribute
- How to query the content of a specific custom post type?
- Advanced Custom Fields: query posts filtered by multiple field values
- Custom Post-type not returning the right child_of
- Looping taxonomy in taxonomy?
- posting twice from an array?
- Inserting two categories
- ACF Relationship: Group posts by parent category term, then child [closed]
- Getting ACF relationship field information
- Display ONLY ONE $term (Out of 4 terms) from a Custom Taxonomy and CPT
- Custom taxonomy meta fields
- Custom Sort Order for Custom Post Type Taxonomy