You could use has_term
Codex, like the following code:
if( has_term( 'jazz', 'genre' ) ) {
echo 'This is something...';
}
Remember to add the third parameter – $post (int or object), if it’s not in the loop.
Related Posts:
- Show Two custom Post type and their posts on category page
- How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
- Get the ID of the latest post
- WP_List_Table Inside Metabox Not Working on Submit
- Showing current taxonomy terms
- Custom permalinks – post type – hierarchical taxonomy’s
- SQL to update custom post taxonomies
- Query multiple taxonomy in Custom Post Type
- automatically create taxonomy with same name as post title
- Querying Posts by Taxonomy From Alternate Network Site
- Display taxonomy term only if there’s a value
- Include different loop templates in search query
- Adding Custom Taxonomy to WordPress default Post type
- Display types of posts in edit.php instead of All, Published, Scheduled and Draft
- Making pages also serve as taxonomies? Or give full pages to taxonomies?
- 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
- How to filter the taxonomy terms based on another taxonomy term
- Custom Taxonomy – Tags Metabox is showing instead of Categories
- Is it possible to create a shortcode that will query a post based on taxonomies?
- How to filter custom taxonomy categories on archive?
- Querying Term Posts in Loop
- WordPress Orderby Numeric Value Not Working
- Am unable to reset a query properly
- Get next and previous 3 posts in a term in single post page
- Making certain categories of CPT not publicly queryable
- Missing Posts in Custom Taxonomy List
- Search / Filter posts on Title/Content OR Tags
- Disable block with taxonomies at post page
- Get parse_query filter to return slug instead of id
- Which post does a taxonomy term belongs to?
- List custom taxonomy specific to one custom post type
- Meta query for custom post type ignored in main query
- How do I move/order posts with a tag to the end?
- Get related posts of child term of custom post type
- Specific query for custom post type
- Display post content with respect to its title?
- First custom field value (out of several) displayed twice after query
- Prioritize posts in query by meta keys?
- WP_Query orderby and tax_query
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- WP the_posts() on single-cars.php get category link
- WP_Query() with custom post type and taxonomy — get all terms?
- Variable not working in WP_Query
- How to Display Posts From Category Within a Custom Taxonomy?
- Can I query posts by taxonomy conditionally based on post type?
- Query not work for current taxonomy
- Display a post from custom post type only if all the selected taxonomies and custom field value matches the record
- display posts of custom post type with custom taxonomy
- Custom Post Type not showing in main loop
- How to query Posts from a custom post type which contains a custom taxonomy?
- Copy/Move selected taxonomy terms to another taxonomy for posts
- Different structure/content for posts from a custom post type
- List all posts in taxonomy term
- Custom taxonomy query showing more than 4 posts
- Custom types, taxonomies and query optimization
- custom taxonomy listing returns no posts
- Query Custom Post by taxonomy multiple categories
- Query custom posts from custom taxonomy
- Making a form for user to add new custom post with custom taxonomies and custom fields
- How to divide Subcategories into pages of parent category wordpress
- Check that a slug is present in the get_terms request
- Is there a way to use ‘publicly_queryable’ => false only on specific taxonomy term?
- Search CPT by tag ids
- Post template with breadcrumb needs to show page navigated from
- What is the best way to structure posts for the same event happening in different years?
- Displaying all posts by category and showing content on click
- Right way to store a large set of similar information on website? [duplicate]
- Define multiple prefixes for custom post type
- WP_Query for custom taxonomies showing posts from non-specified terms?
- I cannot display custom posts in custom taxonomy
- How to manage a dynamic multi-level page hierearchy system?
- post type => ‘any’ not applied my custom queries
- How can I get the last 5 element of this tax query?
- Display title of all custom posts from same taxonomy term on a custom post template
- How to get all posts related to a taxonomy?
- Filter By Term Not Working – Custom Post Type
- Get posts of an specific term of a custom taxonomy
- Query Pulling the same post twice
- Custom Post Status & Taxonomies
- Post Editor: display categories from current post type taxonomy only?
- Linking custom taxonomies and posts
- How to Associate Posts with Pages
- Query Posts From Multiple Post Types
- how to limit query_post to first page?
- Post content stays the same but permalink changes ?
- Listing custom post type items from a couple of custom taxonomies
- Custom My account page and custom page for editing posts
- Get custom post type parent category
- Automatically add custom taxonomy when meta value gets to a set number or beyond
- Sort ACF by custom taxonomy
- How to develop Knowledge center in WordPress Website
- Custom Post Type and Taxonomy URL rewrite
- custom taxonomy – Template not working
- Removing Duplicate Custom Taxonomy Terms from within a Dropdown Select?
- Is it possible to have dedicated page for parent/child taxonomy?
- Different slug taxonomy for two different CPT
- Why does my taxonomy have a category style div id?
- Correct way of adding taxonomy to a custom post type
- Exclude a custom category from a list