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?
- get_terms by custom post type
- Creating “static” taxonomies to choose from, inside custom post type?
- How do I dynamically populate wp_nav_menu from a custom taxonomy?
- Custom taxonomy not showing up when adding a new custom post type
- How to list all categories and tags in a page?
- show tags of custom post type ONLY
- Create an archive page for custom taxonomies
- Taxonomy terms with edit/filter link in wp-admin, in the list of custom posts
- How can you make permalink work for custom post type and taxonomy?
- Internationalize / translate custom post types & taxonomies
- Rewrite custom post & taxonomy to share same URL path
- How do I list terms of a custom taxonomy at i.e. domain.com/brands/
- Add Taxonomy Values Within a Custom Post Type RSS Feed
- Taxonomy-{taxnonomy}.php is not working
- Associate Taxonomies Across Post Types
- Order WordPress Custom Taxonomy Pages & Pagination Not Working
- Relationship between two taxonomies and a custom post type [closed]
- How to make a custom taxonomy selectable in post publish area?
- Problem with custom post types, taxonomy and permalinks
- How to create new category for custom post type?
- Fetch taxonomies by custom post type id array
- Create Custom Post Type Permalink Structure
- Custom page template for category taxonomy
- How can I display an archive of only one category of my custom post type?
- Order By Post Type ThenBy Taxonomy
- How to show CPTs in term archive
- Custom query to filter posts that have current post as a taxonomy [closed]
- How do I get array of types associated with a taxonomy?
- Display all posts in main category and 1 subcategory
- Show category ID on custom post type
- wp_get_post_terms on custom post type with custom taxonomies returning an empty array
- Is using taxonomies the way to go here or would custom post types be better?
- Why are taxonomy terms not saving when using custom meta boxes with radio button taxonomy selectors?
- limit value taxonomy based on previous taxonomy value wordpress
- Using meta_query and tax_query at the same time
- How to make custom taxonomy into drop down select in a custom metabox
- Display latest x posts from all categories in Custom Post Type/Taxonomy
- How to display products name in a non-alphabetical order, in a custom field (taxonomy)?
- How to Set Taxonomy Object Description?
- Custom Taxonomy Is Being Pulled into a Page, But It Doesn’t Have A Hyperlink
- Querying two taxonomies with tax_query not woking
- Variable not working in WP_Query
- Associate all Custom Post Types with Taxonomy
- Invalid Taxonomy
- Alphabetically sort a taxonomy.php template by post title
- Custom Post Types not queried in Custom Taxonomy archives or Native archives
- Show Taxonomies with admin area for custom post type?
- Remove categories taxonomy from custom post type
- Changing CPT slug and taxonomy already registered in parent theme
- Single.php for Custom Post Type > Taxonomy > Term
- Copying over taxonomy structure from one CPT to another
- Sort Archive by Taxonomy
- Menu for taxonomies and posts belongs to taxonomy
- How to automatically create a terms based on each post of a post type
- Page that lists publications by classifying them by taxonomy
- Exclude a specific post in a Custom Post Type
- Filtering posts based on three taxonomies
- Display category filters for custom post type when category is shared by multiple post types
- How to order taxonomy terms by most recent post?
- Custom taxonomy returns 404 even with saving permalinks
- Create custom post type categories
- Get queried object for custom post type count
- How to display all terms from all taxonomies in post, but separately for each taxonomy?
- Set a Default CPT taxonomy by taxonomy id
- Skip latest 3 posts from loop
- List all posts associated under custom taxonomy
- how to create custom taxonomy drop downs for parents and child
- Get name CPT with slug taxonomy
- Add other all taxonomies as meta boxes to custom post type
- How to get post type archive category title
- Automatically / dynamically populating tags in custom post type
- Custom post type category link + add to menu
- One of my headings is mysteriously coming up as a link in my CPT Archive
- Single taxonomy for different custom post types
- Taxonomy and Custom Post type with Collpase
- How to create groups like that in buddypress?
- Organising custom taxonomies and custom post types
- Filter Term By Parent Term – Custom Post Type
- Listing Custom Post Post from certain category
- get children from current variable (taxonomy) via shortcode
- Custom Post Type and Taxonomies, creating the corresponding template file and loop the data
- Custom Post Type parent slug as menu item
- Use Tags to Query Associated Multiple Posts and Get The Average Of Custom Field Values
- List all posts from custom post type by taxonomy
- Archive templates based on taxonomies
- show 10 most recent custom post types excluding the one(s) from specific custom taxonomy
- Sharing a custom taxonomy – No posts?
- show only one category posts in admin
- Get all active posts that are tied to a custom taxonomy for a custom post type
- Is there a function that replace category name with a icon?
- Show custom category archive as front page and remove taxonomy slug from urls
- Categorizing Custom Posts in Bulk Based on Title