I’d use wp_list_filter()
with the operator ‘NOT’ to compare either the term’s name, slug or ID (depending how you want to test for term to be exluded).
Untested but something like this should work (assuming that you want to exclude the term with slug ‘myslug’):
$terms = wp_get_post_terms( $post->ID, 'wedding_cat');
$terms = wp_list_filter($terms, array('slug'=>'myslug'),'NOT');
(Of course this may mean $terms
because empty).
Related Posts:
- Taxonomy: Why ‘with_front’ => false DOES NOT WORK?
- Custom Post Type Taxonomy Filters
- How to conditionally redirect to the post from a taxonomy page?
- I have custom post type with custom taxonomy. But not found the taxonomy page..
- How to display posttypes and taxonomy in standard posts, not in a separate label?
- Display related CPT with custom taxonomy
- Showing taxonomies with terms that are attached to custom post
- How to display elements of different post types?
- How to get all taxonomies of a post type?
- Renaming Custom Post Types and Taxonomies
- get_terms by custom post type
- Saving Taxonomy Terms
- Get Posts by Custom Post Type ,Taxonomy, and Term
- Custom Taxonomy as checkbox or dropdown
- How to change permalink structure for custom post type and it’s taxonomies?
- Get the first post term
- How do I append multiple taxonomies to the URL?
- How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy
- Custom Taxonomy as Dropdown in admin
- Custom Post Type Archives by Date and Taxonomy
- Creating “static” taxonomies to choose from, inside custom post type?
- How do I dynamically populate wp_nav_menu from a custom taxonomy?
- Custom Taxonomy’s Label to change the text appearing in Appearance > Menu
- Assign posts to taxonomy terms instead of the taxonomy terms to posts?
- How to completely disable a taxonomy archive on the frontend?
- How to limit the number of terms (terms acts like categories)
- Taxonomy count per Post type
- Custom Post Type – Taxonomy Dropdown Menu?
- How can I list all the categories under a Custom Post Type (taxonomy)?
- Taxonomy term in permalink
- How do I display two separate taxonomy archives for two post types that share a single taxonomy?
- Custom taxonomy not showing up when adding a new custom post type
- How do I list custom taxonomy terms without the links?
- How to list custom taxonomy categories?
- Custom Taxonomy Template Post List with Sort Order
- Query Custom Post Type taxonomy type based on page
- wp_insert_term doesn’t work with custom post type’s taxonomy
- How to list all categories and tags in a page?
- show tags of custom post type ONLY
- Taxonomy + post_type
- Remove quick edit for custom post type
- Using 1 taxonomy for multiple post types?
- Count posts that have specific taxonomy term attached
- Retrieve single term slug
- Taxonomy archives based on Custom Post Type
- Filtering Posts by Multiple Taxonomy Terms such as in an Admin Post Listing?
- Exclude from search all custom posts which are NOT in a taxonomy term
- Disable Single Post View for Specific Taxonomy on Custom Post Type
- Order Posts by Taxonomy and Meta Value
- How to set individual capabilities on a taxonomy? Or how to re-register an existing taxonomy?
- Create an archive page for custom taxonomies
- Get the ‘slug’ of a custom taxonomy
- Taxonomy page returns 404 page not found
- How to sort list of custom posts to get view like a tree of posts under categories and their children’s categories?
- Taxonomy terms with edit/filter link in wp-admin, in the list of custom posts
- Custom SQL Query on Custom Post Type. Order by Taxonomy?
- It is possible to get a list of post types asociated to a taxonomy?
- display multiple term post from taxonomy in a single page
- How would I leverage custom Taxonomies in this scenario?
- List taxonomies with thumbnails
- How can you make permalink work for custom post type and taxonomy?
- Custom Metabox with Taxonomy Dropdown – Saving Issue
- How to get a list of term names of the custom post type im currently on in single.php
- Exclude post_type from admin comments_list
- How to show term-specific post list, without posts associated with child terms?
- Group list of posts by taxonomy and allow for pagination
- Custom Post Type with Custom Title
- Priority for Categories, Tags, Taxonomies, Posts, Pages and Custom Posts with same url
- How to get the parent’s taxonomy?
- Query multiple taxonomy in Custom Post Type
- Internationalize / translate custom post types & taxonomies
- Adding a term name from a custom taxonomy assigned to a post link displayed by a wp_query loop based on another taxonomy
- Exclude Custom Post Type & Pages From Auto-Tag Function
- Rewrite custom post & taxonomy to share same URL path
- Group Custom post type in a page by its taxomony tag
- create a back-end wordpress content submission using custom post type
- Disable WordPress Recognizing Path as Attachment
- Get the most popular terms for a custom post type
- Include custom post type in “all posts”
- How do I list terms of a custom taxonomy at i.e. domain.com/brands/
- Same base slug for CPT post and CPT taxonomy terms
- wp_insert_post custom taxonomy
- Displaying related posts in a custom post type by a custom taxonomy
- Add Taxonomy Values Within a Custom Post Type RSS Feed
- Custom Post Type: How to display all of same taxonomy?
- Taxonomy-{taxnonomy}.php is not working
- Display taxonomy term only if there’s a value
- Remove “-2” from a Toolset Types URL with the same post name
- Get list of terms of current taxonomy archive for another taxonomy
- Post Link Filter Help [closed]
- exclude custom post type by meta key in wp_query
- List all custom post type posts from a given category?
- Custom Post type taxonomy single templates
- Registering tags taxonomy for a custom post type
- Get all taxonomies for all post types
- Custom post type taxonomy template
- Is slug “type” reserved and can’t be used in taxonomy rewrite?
- Associate Taxonomies Across Post Types
- Use the_taxonomies() to create a simple list
- Custom taxonomy template not working with simple loop. Multiple CPT using the same taxonomy