Use an instance of WP_Query to query the database.
http://codex.wordpress.org/Class_Reference/WP_Query
To query database for custom taxonomies use,
$query = new WP_Query( array( 'people' => 'bob' ) );
For more details on available options see: Taxonomy Parameters
http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters
Retrieve published posts using
'post_status' => 'publish'
Use found_posts
to retrive the number of posts
$count = $query->found_posts;
Related Posts:
- Query users by custom taxonomy and user role
- Custom Taxonomy and Tax_Query
- Custom taxonomy hide meta box but show in menu
- display posts with same taxonomy term
- pre_get_posts with tax_query causes empty result
- Is there a way to disable a term rather than deleting it?
- Best pratice to make taxonomy terms translatable without changing slugs?
- Remove Category description textarea
- How to use wp_terms_checklist() on front end
- Get the latest taxonomy/category?
- Custom taxonomies, with custom rewrites/slug, AND loading a taxonomy archive template from a plugin
- How can I set up a category “overview” page?
- Display custom taxonomy for product
- Problem with query_posts for a custom taxonomy in theme options
- Link to most recently created category of custom taxonomy in primary navigation menu
- Listing child terms of parent term
- Ajax post filter by taxonomy
- Custom Taxonomies but with Icons associated?
- Advanced Tax Query
- Last posts from custom taxonomy
- How To Capitalize Entries In the Taxonomy Box?
- How to filter WordPress search, excluding post in some custom taxonomies?
- I can’t access the pages for my custom taxonomy
- How to prevent posts duplicating when viewing a custom taxonomy term
- Is it possible to create exclusive custom taxonomy?
- Custom Taxonomy Archive BUG
- Date range filter for manage posts list on edit.php
- how does get_term_by know which term to return when the same term appears twice in a hierarchical taxonomy?
- Changing stylesheet depending on custom taxonomy terms
- Taxonomy with_front causes all
- Why is my taxonomy template not shown?
- How Can I Change a Taxonomy URL Based On The Originating URL?
- How To Assign “Taxonomy per Taxonomy”?
- How to add a Rewrite Rule / Category Structure
- Selecting all posts from the children of a particular parent taxonomy
- How to have two different versions of a tag/category/taxonomy archive page?
- Rewrite Rule Working for all but one of the taxonomies created
- How to get all taxonomies which can be added in menu?
- WordPress Tag or Custom Taxonomy Return All Posts if has that Word in Post Title
- display one post out of each custom category (aka “term of custom taxonomy”)
- Get custom taxonomy for visual composer shortcode but not working?
- Display value of custom field of custom taxonomy in single post?
- Custom Taxonomy and Rewrite URL
- WordPress Custom post query sorting does not work
- group posts by taxonomy terms
- List related terms + taxonomies
- Multi-select field for Taxonomy can’t save the value
- How to Display a menu only if it has Posts in Custom Menu?
- How to create a custom taxonomy using a shortcode?
- Custom URLs in Custom Search Results
- how to extract the username of the wordpress user?
- how does the wordpress rest API work
- Why is flush_rewrite_rules mandatory after registering custom taxonomies?
- tax_query not working
- WordPress set taxonomy on post?
- wp_query not resetting, last post hanging
- Set term on an attachment using wp_set_object_terms and want to display the full term text but it’s showing a slug instead
- custom taxonomy not showing in Gutenberg
- Why does wp_remove_object_terms not work?
- how to get term id from current post type instead of name
- Display children category images
- Best way to redirect taxonomy terms to pages
- Dropdown taxonomy lists in admin menu
- Hide echo of no categories from get_object_taxonomies
- How to define %category% for custom taxonomies?
- Filter with two id of the same value CPT UI(taxanomies)
- get_terms does not return any results for my custom taxonomy?
- How Can I Remove Child Slug From Grandchild Slug When Using Duplicate Grandchild Slugs?
- How to Create Multi selection search Form using Default WordPress Category Terms, and Custom post Types Taxonomies Terms?
- How to filter and/or sort user taxonomy query inside custom user taxonomy archive page?
- Create multiple taxonomies with custom fields values on the fly when creating new posts
- How do I get the correct URL?
- Custom Taxonomies Archive Page 404
- How to replace custom post type with custom taxonmy in permalinks
- Cloning product not copying custom taxonomies
- deleted_$taxonomy not getting fired
- Query all images with certain tag in media library using visual portfolio plugin
- Problem with wp_list_category with custom taxomy
- ACF Custom field not showing in Timber Taxonomy page
- Restrict viewing of posts by category, user role
- WP Query : strange behaviour with multiple no-hierarchical tax
- Dynamic drop down of child terms and then drop down posts
- Custom order of taxonomy using wp_get_object_terms and woocommerce_term_meta
- Include attachments with a custom taxonomy in search
- List terms and order by second word
- If term and page have the same slug, how can I view the term archive?
- Does a codex exist for creating meta boxes in taxonomy
- Run next query based on first query’s term
- Get the original menu item name string instead of the label
- How to use tax_query other than by slug or id or solve custom taxonomy tags conflicts with pre-existing tags?
- add custom fields in custom taxonomy meta box in wordpress-3.5.2
- How to permanently delete a taxonomy
- How to query posts that are not related to any term of a taxonomy?
- Function code problem
- add_action with variable as a part of the $tag string
- Display woocommerce product_cat child terms with thumbnails
- How to add a custom page template selector to a custom taxonomy?
- How to display Custom taxonomy on custom post listing page [duplicate]
- add_rewrite_rule pagination 404 error on page 4 and above
- Taxonomies starting with a hyphen (minus) to assign B.C. dates to a post