Cheers guy’s this helped me a lot, I used the below which works great, any improvements appreciated.
<?php
$cat1 = array('category1', 'category2');
if( has_term( $cat1, 'my_custom_post_type' ) ) {
//do something
} else { //do somthing else}?>
Related Posts:
- Get template part based on custom taxonomy term
- If on term-page -> get the current term?
- Conditional Query of Custom Post Type and custom taxonomy
- How to check if post/page or taxonomy post is published by admin
- Showing taxonomy terms on custom post type
- If custom taxonomy else conditional [closed]
- Custom Post Type Permalink / Rewrite not working immediately
- Custom Taxonomy as Dropdown in admin
- Custom Post type in separate database table for syncing
- WP_List_Table Inside Metabox Not Working on Submit
- Creating Photo Gallery System with Custom Post Type
- Custom Taxonomies Terms as Post Title for Custom Post Types upon Publishing
- How to filter post data with AJAX on page?
- Custom permalinks
- WP_Query -> sort results by relevance (= most tags / taxonomy terms in common)
- Correct way to use a form to to filter custom posts by taxonomy terms?
- Custom-Taxonomy as categories: Remove “most-used” tab?
- Custom Permalinks for Custom Post Types and Taxonomies
- how to group custom post type posts by custom taxonomy terms
- Showing current taxonomy terms
- Maintaining WP_Query Relation Among CPT, Custom Taxonomy, Permalinks- CPT UI
- Add filter to wp_list_categories and query what type of taxonomy-terms it use?
- Custom post type category, taxonomy and URL rewrite problem
- Custom Taxonomy order by Custom Field
- changing default comment form arguments [duplicate]
- Custom Post Type: How to display all of same taxonomy?
- Is there any performance consideration when using Custom Post Types?
- Show ACF field from custom taxonomy and display on the single template
- Querying Term Posts in Loop
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Permalinks not working for custom taxonomy on custom post type
- Display custom post type in hierarchical order with get_terms
- Why would this IF statement not work? [closed]
- How to display product subcategories into my custom post type single page
- Am unable to reset a query properly
- Conditional Statement custom post type category
- custom types taxonomy hide_empty
- Display Custom Toxonomy In WordPress and theme Widgets category selection dropdown list
- How to rewrite url for any specific taxonomy?
- Custom post URL 404 error
- WordPress Doesn’t Generate Taxonomy Archive
- How do I require the specification of term in a custom post type and custom taxonomy?
- Custom Post Type Pagination Paginates Only in URL Structure
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- Hierarchial Custom Post Types/Taxonomies
- Only show posts with date of today or in the future (i.e don’t show past posts)?
- Custom Permalinks For CPT and pages with parent. Advanced WordPress
- Migrating Hierarchal Taxonomy Categories Between Post Types
- Removing numerous Meta boxes from numerous CPTs
- How to rewrite the post slug of a custom post type post
- Exclude latest post from WP_Query taxonomy term loop
- Getting List of child terms from custom taxonomy parent
- How can I get 3 different taxonomy type terms in a div class element?
- Get terms for a specfic post from multiple taxonomies in custom post type
- Using page title as a link to term archive
- Add custom post type taxonomy tag to article class
- Custom Taxonomy dont save in a frontend form for post a custom post
- Should i use custom post type for a custom footer?
- best way to use custom taxonomy, post type and meta in a job system
- Display the link of a custom taxonomy
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- Get Posts List of Current Selected Custom Taxonomy in Shortcode
- Custom taxonomy: on the taxonomy term page show other taxonomy terms
- Get the taxonomy value in the post loop inside the archive page
- Error 404 change permalink term custom term taxonomy
- How to display custom post type taxonomy in Contact Form 7 text field
- Custom Post Type & Taxonomies – Rewrite
- Custom post categories are not displaying on the page
- get_posts wont produce a list of custom type from a given category [duplicate]
- PHP Warning with Custom Fields
- Don’t share custom taxonomy terms if applied to multiple Custom Post Types
- How to show custom post count in archive page
- Change CPT permalink to use the category
- How to add independent “Tags” to Custom Post Type?
- Get posts under custom taxonomy and custom post type
- Flush rewrite rules when new cpt is registred
- Shortcode in excerpt
- Previous/Next custom post links within custom taxonomy
- Pretty permalink structure with multiple (AND OR) taxonomies
- Show custom taxonomy not in submenu
- Custom Taxonomy is disabled on Edit page
- Override “Parent” input for custom taxonomy
- WordPress Custom taxonomy template
- Custom Post Type and Custom Taxonomy not connected
- How to Associate Posts with Pages
- Get link for feed of specific post type AND taxonomy
- Why is this custom post type defaulting to archive.php?
- Diffrent search templates for different post types
- Get single object term for custom taxonomy
- Sorting custom post types by taxonomy (So close)
- Check if taxonomy is attached to at least one post in a post-type
- Custom posts and custom taxonomies for many products and categories?
- How to retreive terms associated with a custom post type?
- Return Custom Post Type Categories
- Create taxonomy from Custom Post Type
- Custom Post type as Taxonomy
- ACF Relationship: Group posts by parent category term, then child [closed]
- Custom Post Type urls not working
- pre_get_posts causes Custom Posts appear under ‘Pages’ menu
- Show a wordpress custom post condtionally using a category term