From the WordPress codex for wp_query:
Display posts tagged with bob, under ‘people’ custom taxonomy:
$args = array(
'post_type' => 'post',
'people' => 'bob'
);
$query = new WP_Query( $args );
Display posts tagged with bob, under ‘people’ custom taxonomy, using tax_query:
$args = array(
'post_type' => 'post',
'tax_query' => array(
array(
'taxonomy' => 'people',
'field' => 'slug',
'terms' => 'bob'
)
)
);
$query = new WP_Query( $args );
See the Codex page for more examples.
Related Posts:
- Check if a post has any term in this custom taxonomy?
- Contact Form 7 – Populate Select List With Taxonomy [closed]
- Why is my working Custom Taxonomy not in get_taxonomies array?
- Custom taxonomy hide meta box but show in menu
- display posts with same taxonomy term
- Is there a way to disable a term rather than deleting it?
- SQL QUERY needed to get POST category (taxonomy) ? – MUST be SQL statement
- Remove Category description textarea
- Create taxonomy with meta term using the WP Rest Api
- How can I set up a category “overview” page?
- Sort posts by number of matched terms
- Possible to register multiple custom taxonomies in one function?
- 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
- Advanced Tax Query
- Function to limit the number of posts in taxonomy.php
- Is It Possible To Have Shared WordPress Custom Post Types?
- WordPress renames slug of tags used in multiple taxonomies?
- User role permissions based on taxonomies
- WP Query with custom taxonomy
- How to prevent posts duplicating when viewing a custom taxonomy term
- get_the_terms() to show all custom taxonomies
- Custom taxonomies making WP very slow – Way to fix?
- get_terms: determine if taxonomy term has children
- Set a taxonomy as private
- Get Taxonmy Term ID For Current Post
- meta_key & meta_value not working with get_pages and custom taxonomy
- Is it possible to create exclusive custom taxonomy?
- wp_insert_post not updating custom taxonomy selected if logged in as a subscriber
- Changing stylesheet depending on custom taxonomy terms
- Taxonomy with_front causes all
- Taxonomy archive showing no results
- Get posts by name and taxonomy term
- Autogenerate Front End Form Field With jQuery
- Changing taxonomy term by slug (wp_update_term)
- Taxonomy template shows only 10 posts
- Rewrite Rule Working for all but one of the taxonomies created
- Extend & Search Native WordPress Image Galleries With Tags and Taxonomies?
- How to Rewrite Taxonomy URL to Include the Post Type as the Second Segment of the URL?
- 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
- woocommerce custom product category template
- Custom Taxonomy index/archive hierarchy
- Filter custom taxonomy archive posts by 2nd custom taxonomy using select dropdown
- How to show all post related taxonomies
- Getting associated taxonomies
- Multi-select field for Taxonomy can’t save the value
- WordPress implode & wp_insert_post question
- Get the taxonomy of the post
- how can i display taxonomy instead of category on my web page?
- Taxonomy Meta Box in User Profile?
- 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 template part if part of term
- List Top 5 taxonomy terms based on number of post
- 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
- Taxonomize taxonomy terms?
- Include get_term_link inside search
- Set two terms for a post when they differ only by an accent
- Rewrite Search URL Permalink For CPT Custom Taxonomies
- Listing Cities A custom taxonmy by selection order
- Template taxonomy-{taxonomy}.php doesn’t show my posts
- Unregistered taxonomy apears still as emtpy filter list
- Get Highest and Lowest get_term_meta() value from Taxonomy Term
- Custom Taxonomy Not Being Recognized by is_tax()
- Ignore punctuation marks in taxonomy order by name
- How to truncate the description in the admin panel for a custom taxonomy
- What’s the url queryvar for a taxnomy archive?
- set_object_terms for custom taxonomy in custom post type – not working
- Get all users attached to a taxonomy
- Resize $term attachment using url
- Orderby taxonomy term id using get_posts not working
- Custom taxonomy escaping html attr
- Showing list of custom posts of a custom taxonomy
- Display taxonomy posts
- Show portfolio category slug in url ( if exist)
- switch statement for taxonomy content
- How do you search for a post by custom taxonomy?
- Index page of posts tagged with two separate taxonomies
- Remove taxonomy menu without removing the metabox?
- Sorting Custom Taxonomy in ASC/DESC order?
- create taxonomy
- Select default taxonomy on dropdown
- WordPress Taxonomy Menu
- What is the current page’s Taxonomy?
- get_terms() – unexpected ‘=>’ (T_DOUBLE_ARROW) error
- get_term_children specific no id
- query grandchildren taxonomy terms
- Make custom post type display with custom taxonomy in url
- How do I create a term for every value of a post meta?
- Save selected terms in order of custom taxonomy in post
- Add text in custom taxonomy
- How do I check if a post has a term with a particular ancestor/parent?
- Taxonomy entries are spawning copies of existing entries with the new title as the existing ID, since upgrade