SOLUTION
<?php
$args = array(
'post_type' => 'product',
'post_status'=>'publish',
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'sectors',
'field' => 'slug',
'terms' => 'garden',
),
array(
'taxonomy' => 'season',
'field' => 'slug',
'terms' => 'winter',
),
),
);
$query = new WP_Query( $args );
echo $query->post_count ;
?>
Related Posts:
- query multiple taxonomies
- Sort the main query in subcategories/terms?
- Query/list all terms and their custom post count
- Filtering WP_Query Dynamically on the Front-End
- Post count by month of taxonmy term
- WordPress loop: Show only a Custom Post Type Taxononmy TERM
- how to count the current posts terms
- How to count other posts not having specific taxonomy terms?
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- get_queried_object not work in taxonomy page
- Display all Custom taxonomy terms and their relevant custom posts
- Get posts of an specific term of a custom taxonomy
- How to pass taxonomy terms to WP_Query along with $args?
- How to Get The Taxonomy Term in Custom Post Type Loop Inside a Wp Query
- Complex Custom Loop with Includes
- Get Posts by Custom Post Type ,Taxonomy, and Term
- Get The Post Type A Taxonomy Is Attached To
- How to limit the number of terms (terms acts like categories)
- wp_get_object_terms(): count relative to passed IDs?
- Count posts that have specific taxonomy term attached
- Maintaining strict one-to-one association between terms and custom posts
- Displaying Posts Related to Other Posts by a Taxonomy Term?
- If on term-page -> get the current term?
- Adding a term name from a custom taxonomy assigned to a post link displayed by a wp_query loop based on another taxonomy
- Querying Posts by Taxonomy From Alternate Network Site
- custom post type paging not working past page 3
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- Creating a function that receives the taxonomy terms that have been changed in a custom post type
- Query for posts in 2 taxonomies
- Get all taxonomies for all post types
- Get the terms of a custom taxonomy for a specific author in author template
- How do I provide a “show all posts” link in a paginated term archive?
- WP_Query search posts by custom post type and custom taxonomy
- get_queried_object error How to show post count by month in the taxonomy page
- Is it possible to create a shortcode that will query a post based on taxonomies?
- Count posts with specific term_meta
- Custom Post Type Loop within Shortcode
- get_post_meta returns empty array for terms
- Display CPT posts based on specific taxonomy
- Custom Post Type Archive Page Filtering
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Get posts by querying taxonomy and certain terms of the taxonomy?
- Return one unique custom post type result when it shares a custom taxonomy in WP_QUERY?
- Displaying custom taxonomy in the admin list of a custom post type
- How can I made custom taxonomies relationship?
- Custom taxonomies relationship
- How do I display the taxonomy for a custom post type in an array
- First custom field value (out of several) displayed twice after query
- Custom while loop for hierarchical display of a taxonomy
- Lists custom taxonomy terms that has specific custom field value assigned to the term (not post)
- Display taxonomy terms, child terms and posts in a template
- Use custom walker to add taxonomy terms to main nav menu
- WP_Query orderby and tax_query
- Add term to custom post type on draft
- Listing all term items alphabetically / sorting loop
- How to get WordPress term attached to the Post?
- How to make WP_Query not to show irrelevant posts?
- Get parent category id from child category page for custom taxonomy
- Create an archive page for custom post type with custom taxonomy
- How to get only child terms from a custom taxonomy of current post type?
- WP_query – Filter by tax_query and meta_query using multiple select
- Custom Post Types Archives and Single Pages not showing custom taxonomy data
- how to get this tax_query working?
- Get terms of a post but only if they’re also the child of a specific term
- How to sort a WP_Query by a custom field AND ALSO filter by a different custom field
- display posts of custom post type with custom taxonomy
- How to display custom taxonomy term meta on custom post type
- Custom post type and custom taxonomy 404 on page 2
- tax_query (if the terms are empty)
- does wp_insert_term link the term to a certain post ID?
- Get posts by category name
- Grab all Custom Posts by multiple taxonomies and terms
- WP_Query order custom post type with certain meta key value by post modified date
- Using get_terms() to list terms from one custom taxonomy AND from one specific built-in category
- set object terms after some some time of published post – functions.php
- Sort custom posts by date and then by taxonomy
- How to search through all child taxonomies using WP_Query?
- Change the term based on the value of a $variable using wp_update_post in submitting a form
- WP_query sort by taxonomy
- Dropwdown: Get taxonomy terms from posts that share preselected terms from 3 other taxonomies
- Custom Post Type / Taxonomy / Term – what template to use to avoid 404-page?
- Display title of all custom posts from same taxonomy term on a custom post template
- wordpress does not see the correct custom taxonomy hierarchy
- Get category list & taxonomy list from different post type using post id?
- Why get_posts() returns empty array while I am trying to get posts from some specific taxonomies and work properly with others?
- Filter By Term Not Working – Custom Post Type
- WordPress add taxonomies/terms list as a menu in archive page
- Hide Custom Taxonomy title if not associated with another Custom Taxomony
- WP_Query for CPT with filter by another WP_Query
- Custom Taxonomy Query by Taxonomny not working
- How to query posts by meta keys AND under specific category?
- Shortcode display CPT Query only showing 1 post?
- Storing/querying custom date data
- WP Query Post Type with same Taxonomy name
- Catergory args causing loop not to show
- Display associated taxonomy child name on single CPT page
- Get all terms assigned to a post from different taxonomies
- Issue On Listing Woocommerce Parent Tag List
- Get term link of shared taxonomy between multiple post types
- How to use wp_set_object_terms depending on page ID?