Your code is not listing the terms from post A, it is listing all the terms on your site. You can test this by creating a post Z and adding new terms to Z, you will see those new terms listed on all posts, even post A.
The reason is this:
$terms = get_terms($taxonomy);
get_terms
does not get the terms on the current post, it just gets terms.
If you only want the terms the assigned to the current post, you need to use wp_get_post_terms
instead
$terms = wp_get_post_terms( get_the_ID(), $taxonomy );
https://developer.wordpress.org/reference/functions/wp_get_post_terms/
Related Posts:
- Custom Taxonomy Meta Admin Column
- How to show taxonomy meta on frontpage?
- Insert form checkbox at bottom of taxonomy edit term page
- How to show the a custom taxonomy term on single post metadata
- Add Custom Taxonomy for Blog Meta Info
- Creating conditional to display taxonomy term meta
- Remove taxonomy base or term from url
- Bulk term assignment for attachment taxonomies
- Why is my working Custom Taxonomy not in get_taxonomies array?
- Taxonomy slug by term ID
- How to enable hierarchical permalinks for hierarchical taxonomies
- Create taxonomy with meta term using the WP Rest Api
- Use custom posts as taxonomy term meta replacement?
- Best practices for complex taxonomies
- wp_get_object_terms – How can I order the resulting array by hierarchy?
- Remove description in custom taxonomy edit screen
- How to output the taxonomy term name in a widget
- Make Custom Taxonomy Category Use Parent Template
- custom post type category page
- Advanced custom fields – taxonomy terms images [closed]
- How to call custom taxonomy categories with shortcodes
- How to get terms of a custom post type in a loop inside footer.php
- Is It Possible To Have Shared WordPress Custom Post Types?
- How do I make a custom taxomony appear like tags?
- Refine user taxonomy query based on role
- Get ID and slug from taxonomy object
- List the number of posts for each custom taxonomy and specific custom field value
- How can I conditionally change the title of a taxonomy meta box?
- Recreating the hierarchy of taxonomies for a dropdown form menu?
- meta_key & meta_value not working with get_pages and custom taxonomy
- showing custom taxonomies w/custom post type
- Display sub categories and their data of a taxonomy
- Exclude Taxonomy Terms from Template Via Back End?
- How to overwrite registered taxonomy url from vendor plugin in child theme
- Dynamic loading of Archive content based on custom taxonomy term name
- Checking return with WP Error
- Add multiple taxonomy filters to edit.php that support search
- Extend & Search Native WordPress Image Galleries With Tags and Taxonomies?
- Set taxonomy fields on post with AJAX
- A way to query custom taxonomies by name
- Custom Taxonomy index/archive hierarchy
- Show related posts that match two categories
- Failure to add term meta
- Hierarchical Taxonomy Terms Select Menu Output with selected=”selected” Set
- Sorting Custom Posts on Archive page with pagination
- Removing “s” from search with custom parameters
- get_term_children returns unknown int though term has no child
- Search Query for Multiple Terms In Same Taxonomy
- Custom taxonomy pagination
- Get the taxonomy of the post
- Custom taxonomy not showing terms in post area
- How to Modify Default Text in a Custom Taxonomy Admin Panel?
- Problem with wordpress pagination
- Why isn’t the ‘no results’ being shown when a query returns no results?
- How to get_the_term_list() from multiple taxonomies?
- link directly to custom post if there is only one in the taxonomy
- Add a term to list in block editor taxonomy sidebar
- Show only the sub-categories (and their content) of the current custom taxonomy with ‘taxonomy.php’
- How to get custom post type categories in an array
- WordPress modify Settings > Permalinks (options-permalink.php) Add CPT Permalink Options
- How do I make multiple dependent input fields that use the jquery autocomplete function?
- Also show terms that are related to draft and pending posts
- Breaking Bootstrap Grid at Post Count with Tax Terms
- Displaying Posts Attached to Custom Taxonomy Terms
- Update Post Taxonomy Automatically Based On Date
- Custom taxonomy page not working
- What is the best way to change sidebars based on custom taxonomy terms?
- Displaying the post count of all custom taxonomy terms in a list format
- Automatically tag posts based on user-defined words [closed]
- How to update post taxonomies (Creating a custom UI for Custom Taxonomy)
- Taxonomy dropdown metabox in the back-end
- Taxonomy archive uses incorrect template when query strings are used
- wordpress mysql / wpdb ajax load more for terms help
- Get child product categories from parent product category for CUSTOM TAXONOMY archive page
- How to get related taxonomies based on a category with mysql query?
- Reorder a page of posts of a certain taxonomy/value by a custom field
- Conditional if is single and part of the custom taxonomy
- how to show product custom taxonomies in woocommerce rest api
- Auto add custom taxonomy to permalink when save
- Custom taxonomy – no posts found
- WP Tax query & order by tax query not working
- Show latest used taxonomy in homepage
- Link a page from admin to a custom taxonomy
- What’s the url queryvar for a taxnomy archive?
- set_object_terms for custom taxonomy in custom post type – not working
- Custom button on custom taxonomy listing page
- Custom Taxonomy Archives Page Errors
- Permalink Rewrite to include Custom Taxonomy Term
- Where is defined a custom register_taxonomy? [closed]
- Differentiate Parent & Child of Custom Taxonomy
- Listing all selected terms for custom taxonomies on a post
- Multiple Taxonomy in URL/Query – No Custom Post Type
- Calling Custom Taxonomy Dropdown in Form
- Displaying Custom Taxonomy List Posts By Slug?
- Show different sidebar on taxonomy pages when a default is set
- How can I get parent term from a child term
- Custom Taxonomy – Archive for the whole Custom Taxonomy (and not just single term)?
- ACF Display Taxonomy Image Field
- Guest author – URL, base and custom taxonomy – working but unstable
- Add taxonomy fields of posts into RSS feed