I can’t really explain it any better than the ACF documentation page I posted in the comments:
All the API functions can be used with a taxonomy term, however, a second parameter is required to target the term ID. This is similar to passing through a post_id to target a specific post object.
The $post_id needed is a string containing the taxonomy name + the term ID in this format: $TaxonomyName_$TermID
So if your custom field is my_cf
, and your taxonomy name is basic
(not term name) and the term ID within your taxonomy is 42, then you need:
$variable = get_field( 'my_cf', 'basic_42' );
Related Posts:
- How to add contents of a custom field to a taxonomy term list?
- Order get_terms using a Custom Field
- Remove Category description textarea
- Advanced custom fields – taxonomy terms images [closed]
- Automatically assign taxonomy term if custom meta value exists
- Outputting an array of term meta values in a custom WooCommerce tab?
- Operations with custom fields values in a loop
- Print terms with taxonomy and metabox value
- Can I use a Custom Meta Value inside of ‘get_the_terms’?
- Search Tool only refreshes Page without showing results
- Display value of custom field of custom taxonomy in single post?
- How to fetch the data from Advanced Custom post when we search specific keyword or field name related to the post?
- WordPress implode & wp_insert_post question
- How to support fifteen thousand terms in WordPress?
- Can’t get taxonomy ID for each post on archive page
- Show related posts on single.php, grouped by taxonomy terms, with Advanced Custom Field post object selected
- How to use custom slug and custom templates for custom taxonomy?
- Count tags for current post and save into custom meta field (and update it on post edit)
- Create new Taxonomy, add extra fields, register terms AND extra fields values?
- ACF Custom field not showing in Timber Taxonomy page
- How to filter a taxonomy meta field to the ‘single_term_title’ filter hook
- Get the the top-level parent of a custom taxonomy term
- get_terms – only top level
- How to only list the child terms of a taxonomy and not their parents?
- Hierarchical taxonomy UI
- How to modify the query in taxonomy-custom.php to sort term archives by a custom meta field?
- Can I lock down custom taxonomies on a parent term level, but not a child term?
- Exclude specific slug in ‘get_terms’
- Return only the custom sub-term for custom post type, do not echo term-parent
- wp_insert_term is adding a term that has no name
- get_terms showing link to category even if all posts are drafts
- register_rest_field for custom taxonomy fields that are assosiated with custom post type
- Retrieving custom taxonomy in order, but excluding specific tax IDs
- Group posts that matches a term in a loop
- Custom Taxonomy Images with Advanced Custom Fields
- How to display term description in empty terms archive?
- Checking if a Page has an Associated Term?
- Displaying ACF image field [closed]
- How get custom field from custom taxonomy?
- get_terms custom order
- Limits amount of terms displayed? Is it possible?
- How to List Parent Term Links for Custom Taxonomy With & Without Children?
- Check if term is in a taxonomy?
- Hide custom field if empty
- Get child product categories from parent product category in WooCommerce
- How to show only terms by id or slug on edit-tags.php (custom taxonomy manage page) for a custom taxonomy
- Display the description of taxonomy terms
- get_terms adds slaces to the resualt
- get_term and get_term_by return null or false, even though term exists
- one term two taxonomy’s?
- Conditional display for custom fields/taxonomy
- How do I modify the “Insert Media” lightbox in the admin to only show media items from a category?
- Getting WooCommerce product related child categories
- How do I display a custom field from a custom taxonomy in single.php?
- Best structure for entering recipes in a WordPress theme?
- Having Issue on Passing Variable into HTML Class Tag
- Website loading slowly – Advanced Custom Fields images
- Copy/clone/associate Custom field to Custom Taxonomy
- Query posts using custom taxonomy and selected terms
- Proper use of wp_get_object_terms
- Output all terms in a custom taxonomy and add a “active” class only to the ones attached to the current post
- one post per term taxonomy
- How to check if a post has at least 2 terms from a custom taxonomy attached?
- How can I change the output display of my pagination?
- Terms change id after importing
- How to add a date creation field when a custom taxonomy relationship is created?
- Why can’t I access Custom Taxonomy metadata?
- Adding Child Terms Programatically – No Warning but No dice either
- Running a function only once when a taxonomy term is changed
- Set post terms by term id
- Taxonomy or Custom Field
- Displaying my custom taxonomies in a using the_term_list()
- Use wp_list_categories to list parent categories from actual term
- Trash Bin for Categories?
- using wp_insert_term to create custom terms for a custom taxonomy from frontend form,
- ACF – Retrieve custom taxonomy from a relationship field
- is there a way of getting term children that only shows those from two taxonomies
- get_field values for each post on home page using wp_add_inline_style
- Get Terms of custom Taxonomy of products with certain Product Category
- How to add a shortcode function that returns the taxonomy slug of the actual post within the loop
- Tree view wp-admin terms
- Retrieve the child terms by having the parent’s information
- Convert post meta to custom taxonomy?
- Order get_terms by count using a custom taxonomy hierarchy
- How to create a non removable taxonomy term?
- WordPress taxonomy terms archive template help
- Is it possible to sort the post based on a custom field?
- Why get_terms() behaves strangely when being called in admin (for use in meta box)?
- qtranslate-x problem with custom term description
- sort Posts by custom user filed
- Sorting terms individually for each post
- Register custom taxonomy from a Advenced custom field option page
- get_terms returns array starting at 4
- Multiple category lists on one page
- Any way to make custom taxonomy field searchable?
- get_the_terms inside save_post gives old terms
- How to delete unused terms?
- Custom Sort Order for Custom Post Type Taxonomy
- Foreach for get_the_terms for hierarchical taxonomy don’t repeat Top Level Terms if contains multiple Second Level Terms
- Gravity Forms with Advanced Post Creation Add-On not updating ACF fields on custom taxonomy