If the taxonomies in question are used ONLY in the post_type in question, then the following simple function will do what you need:
function
count_term_use ($post_type)
{
$args = array (
'taxonomy' => get_object_taxonomies ($post_type, 'names'),
) ;
foreach (get_terms ($args) as $term) {
echo "$term->name - $term->count\n" ;
}
return ;
}
However, if a taxonomy is shared by multiple post_type’s then the above counts will reflect the total number of posts of any type that use the term, which is not what you’re looking for. If that is true in your case, let me know and I’ll post the more complicated (and expensive in terms of execution time/db queries) code.
Related Posts:
- how to group custom post type posts by custom taxonomy terms
- How to get the parent’s taxonomy?
- Query for posts in 2 taxonomies
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- Archive for custom taxonomy lists all posts instead of current taxonomy
- How to display Related Posts based on number of taxonomy terms matched
- How to make WP_Query not to show irrelevant posts?
- Custom post type, custom taxonomy, query posts only from taxonomy (children of)
- How to count other posts not having specific taxonomy terms?
- Sorting the Loop by Taxonomy Value
- custom post type and a “sticky” position taxonomy
- display post count in archive page that have relation with another taxonomy term
- WordPress custom post type
- Complex Custom Loop with Includes
- How do I query a custom post type with a custom taxonomy?
- $wp_query->queried_object->ID throws warning: Undefined property
- The Operator “NOT IN” Does Not Work In tax_query
- Display Custom Post Type Fields
- How to get_queried_object on multiple objects?
- Displaying Posts Related to Other Posts by a Taxonomy Term?
- Querying Posts by Taxonomy From Alternate Network Site
- Help with hierarchical custom taxonomies and permalinks…almost there
- 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?
- Taxonomy list. Order by a specific custom post type count
- How to get only one category of custom post type?
- Optimised Code for Pulling Taxonomy Posts
- How to dynamically build a multiple taxonomy query loop within a post type’s single loop?
- 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
- List custom post type by custom tax term as page title
- Custom query shows custom post types in trash
- Count posts with specific term_meta
- Fetch taxonomies by custom post type id array
- shortcode to show custom post types by category
- Filtering WP_Query Dynamically on the Front-End
- Why get_posts() not returning only selected category posts from Custom Post Type?
- How to use custom taxonomies to reference complex relationships?
- Return one unique custom post type result when it shares a custom taxonomy in WP_QUERY?
- Query Custom posts of same taxonomy as the post itself
- Get latest 3 posts from multiple CPT in one query
- Conditional Query of Custom Post Type and custom taxonomy
- Show a Category X’s custom post type on Category X archive page?
- Post count by month of taxonmy term
- Custom WP Query on custom meta and sort by multiple meta keys value
- How can I made custom taxonomies relationship?
- Custom taxonomies relationship
- How to edit this code to get the categories in achieve page?
- First custom field value (out of several) displayed twice after query
- Add Custom Post Type of specific Custom Taxonomy to regularly blog loop
- WP_Query orderby and tax_query
- Different Ways to Query Custom Post Types?
- Listing all term items alphabetically / sorting loop
- Loop for custom post types filtered by a taxonomy
- WordPress wp_query() basic question about args
- Create an archive page for custom post type with custom taxonomy
- WP_query – Filter by tax_query and meta_query using multiple select
- how to get this tax_query working?
- find custom post type post by searching its custom field with my string
- FacetWP paging custom wp_query
- How to sort a WP_Query by a custom field AND ALSO filter by a different custom field
- I am trying to get cutom post cout by month of current taxonmy term
- How to get the post terms from a child taxonomy
- Custom post type and custom taxonomy 404 on page 2
- tax_query (if the terms are empty)
- Can’t change posts per page in WordPress Post Type Query
- List all posts in taxonomy term
- Get posts by category name
- WP_Query order custom post type with certain meta key value by post modified date
- Cant’ Display Custom Post Type Title Base on Tax Terms
- Query Multiple Custom Post Types & Exclude a Taxonomy Term
- Custom Post Type Query W/Category Dropdown
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- Find Posts based on Child Post value
- 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?
- Posts per Page on custom Taxonomy Template
- get_queried_object not work in taxonomy page
- minimize wp_query call to database
- WP_query sort by taxonomy
- Custom Taxonomy – fields
- CPT Loop, include taxonomies and disclude others?
- Getting Custom Posts with Custom Taxonomy
- Why get_posts() returns empty array while I am trying to get posts from some specific taxonomies and work properly with others?
- Custom post type and custom taxonomies display
- WP_Query for CPT with filter by another WP_Query
- How to pass taxonomy terms to WP_Query along with $args?
- 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?
- Custom Query With Multiple Meta Key Value
- Storing/querying custom date data
- WP Query Post Type with same Taxonomy name
- Advanced Custom Fields: query posts filtered by multiple field values
- Inserting two categories
- How to exclude certain portfolios from a loop
- WP Query Conditionally query meta and taxonomy
- Assign a tag to custom post type using a query
- WP Query – Can’t get posts with specific taxonomy