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
- Get Custom Taxonomy ID within loop
- Categories under custom post types doesn’t show properly
- Retrieve a specific field from taxonomy term through advanced custom fields [closed]
- Ajax filter with custom taxonomies
- List events by month
- Get Custom Field Values by Another Custom Field in WordPress
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- Link users to a custom post type
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Weird problem happening with custom taxonmy when creating/updating posts
- Create 3 Level Relations with ACF and WordPress
- 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?
- Why are taxonomy terms not saving when using custom meta boxes with radio button taxonomy selectors?
- Custom post type editor with dynamic selects, one drop down populating a second second drop down not working
- Query Custom Post Type Taxonomy term with multiple parameters
- 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
- How to define the template for custom posts?
- Query entries from custom post type in an ACF flexible content field
- 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]
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- 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
- Foreach loop returning more than one item when querying taxonomy
- Function to erase every post from a taxonomy
- Compare Two Custom Post Types Using The Same Custom 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?
- Custom post type page with parameter
- How to get post count of specific taxonomy that have store name & category
- 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
- Get all post under custom post type grouped by custom filed value in custom taxonomy
- Sort custom posts by date and then by taxonomy
- Check that a slug is present in the get_terms request
- Display Custom Field or Custom Taxonomy in front page /post/product
- pagination problem listing custom post types of taxonomy in wordpress
- If ACF Post Object post has custom taxonomy term…
- Some posts not displaying by taxonomy term
- Taxonomy shows up twice on Custom Post Type
- How to display custom post type pagination buttons when processing AJAX request
- Filter Custom Post Type Posts by Taxonomy
- Change Search display for Custom Post Type
- Custom search for a custom post type in WordPress
- Display custom tax in “while” loop
- tax_query not working?
- CPT: execute code after load if parameter is set
- Add active class to foundation 6 tabs while looping categories
- ACF Post Content Not Being Searched
- Group/list/sort custom post type posts by date in tabs from acf datepicker field
- WordPress query posts by custom post type not workng
- Show custom taxonomy not in submenu
- Getting a 404 on single custom post type page when using rewrite on a custom taxonomy
- Can’t pick up a field created with Advanced Custom Fields
- Pods pagination erases my sub menu
- How to Fix WordPress 500 Internal server error due to custom post type
- Custom post tag images not displaying with ACF
- How to query posts by meta keys AND under specific category?
- Exclude Custom Post Type from shared Custom Taxonomy
- 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?
- Custom Loop for custom post type. Compare by meta_value?
- 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
- How to I add count of custom posts listed in a post as a prefix to its title
- How do loop categories post from according in WordPress? is it impossible to solve this problem?
- ACF Pro simple Business Directory – Requesting assistance with created Templates and associated Functions.php Coding