A simple function to count posts did the trick, but this is one more request in DB :
function count_posts_in_cat_by_custom_term( $category_ID, $custom_taxonomy_name, $custom_term_id ){
$args = array(
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => -1,
'category' => $category_ID,
'tax_query' => [
[
'taxonomy' => $custom_taxonomy_name,
'fields'=>'term_id',
'terms' => $custom_term_id,
]
]
);
$posts = get_posts($args);
return count( $posts );
}
Related Posts:
- How to add images to taxonomies?
- Custom Taxonomy and Tax_Query
- SQL QUERY needed to get POST category (taxonomy) ? – MUST be SQL statement
- Combine multiple custom user taxonomy in single url
- List taxonomy / category count showing list published posts only
- Advanced Tax Query
- Taxonomy , subtaxonomy,child taxonomy of a product woocommerce
- How to display custom taxonomy in multiple columns?
- Custom taxonomies making WP very slow – Way to fix?
- Sorting taxonomy columns by meta value numeric
- Get pages only with a specific taxonomy
- Get Taxonmy Term ID For Current Post
- Changing stylesheet depending on custom taxonomy terms
- Taxonomy archive showing no results
- Get taxonomy parent using child slug (from merged taxonomies)
- How do I taxonomy terms based on terms they are used alongside?
- Custom taxonomy [year] is directing to yearly archive
- Taxonomies on custom taxonomies
- Getting associated taxonomies
- How to add images to taxonomy terms? [duplicate]
- one post per term taxonomy
- Custom arguments in WP_Query
- WP_Query tax_query – Show results if child has parent X
- Query custom taxonomy for category including children
- Prioritise Pages over Taxonomy Term Root Archive, but not Taxonomy Term Child Archives
- Tracking the name of a custom taxonomy
- Add terms to a taxonomy archive from within the same taxonomy
- Fill New Taxonomies
- Custom Taxonomies Archive Page 404
- how do you pull data from two taxonomies?
- How do you search for a post by custom taxonomy?
- 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
- WordPress Taxonomy Menu
- Make custom post type display with custom taxonomy in url
- Complex Taxonomy scheme
- Querying posts globally based on custom taxonomy with its own taxonomymeta table
- Contact Form 7 – Populate Select List With Taxonomy [closed]
- Why is my working Custom Taxonomy not in get_taxonomies array?
- How do I filter posts by taxomony using AJAX
- Create taxonomy with meta term using the WP Rest Api
- Taxonomies not appearing in columns on dashboard
- Echo taxonomy term meta on author.php
- Hierarchical display of custom taxonomy
- How to output the taxonomy term name in a widget
- How to link categories to custom taxonomy terms?
- Save Filter for Taxonomies
- Is It Possible To Have Shared WordPress Custom Post Types?
- WordPress renames slug of tags used in multiple taxonomies?
- Get ID and slug from taxonomy object
- How do I sort posts by custom taxonomy?
- meta_key & meta_value not working with get_pages and custom taxonomy
- Display sub categories and their data of a taxonomy
- Advanced Query Logic With Multiple Taxonomies
- wp_insert_post not updating custom taxonomy selected if logged in as a subscriber
- Taxonomy template shows only 10 posts
- How to Filter custom post type by taxonomy?
- Get taxonomy based on another taxonomy slug
- Extend & Search Native WordPress Image Galleries With Tags and Taxonomies?
- How do I display the grand child items of a taxonomy term?
- Custom Taxonomy index/archive hierarchy
- Filter custom taxonomy archive posts by 2nd custom taxonomy using select dropdown
- How to show all post related taxonomies
- Custom taxonomy.php not working
- Get the taxonomy of the post
- How Parent Taxonomy automatically added to the post when using `wp_set_object_terms()`?
- Get object for a few selected taxonomies
- Get only immediate children (and not grandchildren) of a hierarchical custom taxonomy term
- How to group all terms children’s in custom taxonomy?
- Show only the sub-categories (and their content) of the current custom taxonomy with ‘taxonomy.php’
- Using Advanced Custom Fields Relationship Field to select a taxonomy term
- Loop through custom taxanomy in post and display custom fields from posts
- query_posts that have custom taxonomy and limiting what shows based on the taxonomy
- Custom Taxonomy Not Saving in Front End Post
- “Menu order” being ignored when querying posts from a parent taxonomy with “include_children” set to true
- How to get related taxonomies based on a category with mysql query?
- Tax-query on taxonomy doesn´t work
- Unregistered taxonomy apears still as emtpy filter list
- Get Highest and Lowest get_term_meta() value from Taxonomy Term
- Ignore punctuation marks in taxonomy order by name
- set_object_terms for custom taxonomy in custom post type – not working
- Get all users attached to a taxonomy
- How can I get all the posts that are related with a specific taxonomy term?
- Resize $term attachment using url
- List active taxonomy terms
- Custom taxonomy escaping html attr
- Showing list of custom posts of a custom taxonomy
- Show portfolio category slug in url ( if exist)
- switch statement for taxonomy content
- tax_query showing no results
- Index page of posts tagged with two separate taxonomies
- Adding a query var to taxonomy term archive – gets redirected to the other taxonomy archive page
- create taxonomy
- Select default taxonomy on dropdown
- What is the current page’s Taxonomy?
- get_terms() – unexpected ‘=>’ (T_DOUBLE_ARROW) error
- Get taxonomy image for Toolset custom taxonomy through Toolset Views Shortcode
- query grandchildren taxonomy terms
- Save selected terms in order of custom taxonomy in post
- Taxonomy entries are spawning copies of existing entries with the new title as the existing ID, since upgrade