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 to query custom post types posts filtered by multiple custom taxonomies through a form selection
- shortcode to show custom post types by category
- Display custom post type from dynamic custom field
- How to make sure content doesn’t display if selection is empty
- Filtering WP_Query Dynamically on the Front-End
- Why get_posts() not returning only selected category posts from Custom Post Type?
- Genesis filterable portfolio isotope [closed]
- wp_query check if integer exists in custom field’s array
- Wrong request query on cpt and tax
- Get custom taxonomies from multiple posts
- Pagination for Custom Taxonomy Page [duplicate]
- Search / Filter posts on Title/Content OR Tags
- WP_Query most viewed posts, in multiple Post Types, last 30 days, excluding a specific taxonomy term
- Custom-Posttype & Custom Taxonomy WP_Query
- Custom loop with multiple taxonomy queries
- 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?
- Custom taxonomy rewrite give pagination 404
- WP_Query inside foreach loop returning same value for all options when filtered using ajax
- Post count by month of taxonmy term
- Custom WP Query on custom meta and sort by multiple meta keys value
- WordPress loop: Show only a Custom Post Type Taxononmy TERM
- How can I made custom taxonomies relationship?
- What’s the WP way to load remaining custom posts?
- Custom taxonomies relationship
- Polylang non-default language ignores tags in WP_Query
- How to edit this code to get the categories in achieve page?
- How to have this permalink structure: post_type/postname/custom_inner_page
- Query Custom Post Type Taxonomy term with multiple parameters
- 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
- Advanced search form with filters for custom taxonomies
- pagination not working for category.php (custom post types in categories)
- Why is my WP_Query outputting my entries twice?
- Retrieve custom post types by custom taxonomies with WP_Query
- WP the_posts() on single-cars.php get category link
- tax_query not working in template
- Custom Taxonomy Not Showing in Front-End When Outputting a Custom Post Type with WP_Query()
- 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
- Using page slug in wp_query
- WP_Query() with custom post type and taxonomy — get all terms?
- Custom query – get_the_terms not work
- Custom taxonomy wp_query woes.
- Variable not working in WP_Query
- WP_query – Filter by tax_query and meta_query using multiple select
- Creating two loops based on different logic
- Wp Query with multiple custom tag(taxonomy) by get the terms
- Control content before and after custom post type loop
- Display custom posts randomly in custom taxonomy archive
- WP_Query parameter conflict
- Not able to export large no. of posts in csv
- attach CPT data to a taxonomy
- how to get this tax_query working?
- Pagination not working on custom query on a page
- Targeting custom post type via functions.php doesn’t work
- find custom post type post by searching its custom field with my string
- FacetWP paging custom wp_query
- Different options per post type in 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 show all taxonomies within custom post type loop
- How to get the post terms from a child taxonomy
- Custom Category Walker with Image, Fallback to Most Recent Post in Category Image
- display posts of custom post type with custom taxonomy
- Custom post type and custom taxonomy 404 on page 2
- how to count the current posts terms
- tax_query (if the terms are empty)
- Trying to add a class to post links
- Can’t change posts per page in WordPress Post Type Query
- postsperpage value not being applied
- Exclude latest post from WP_Query taxonomy term loop
- How to query Posts from a custom post type which contains a custom taxonomy?
- Query Posts that have Custom Taxonomy
- List all Custom Post Type posts excluding certain Taxnomy term
- List all posts in taxonomy term
- Get posts by category name
- Foreach loop returning more than one item when querying taxonomy