The colours are associated to the individual terms, so the process is to get the terms for the current post, then load and display the field for each term.
$terms = get_the_terms( get_the_ID(), 'colour' );
if( $terms && ! is_wp_error( $terms ) ){
foreach( $terms as $term ){
// show color code
echo get_field( 'colour_acf', 'colour_' . $term->term_id );
// or insert color code into background-color of a div
echo '<div style="background-color:' . get_field( 'colour_acf', 'colour_' . $term->term_id ) . '"> </div>';
}
}
Related Posts:
- Order get_terms using a Custom Field
- Get value in custom field with taxonomy [closed]
- Remove Category description textarea
- Custom Taxonomy Images with Advanced Custom Fields
- Advanced custom fields – taxonomy terms images [closed]
- Displaying ACF image field [closed]
- Operations with custom fields values in a loop
- ACF vs Taxonomies
- Specifying a size when displaying an image associated with a taxonomy through ACF
- How to add contents of a custom field to a taxonomy term list?
- 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
- Website loading slowly – Advanced Custom Fields images
- Can’t get taxonomy ID for each post on archive page
- Loop to display ONLY custom taxonomy parent information [closed]
- Using Advanced Custom Fields Relationship Field to select a taxonomy term
- query to use to link to taxonomy single page
- Show related posts on single.php, grouped by taxonomy terms, with Advanced Custom Field post object selected
- Why do my quick edits for custom taxonomies not show on the post frontend?
- Echo ACF taxonomy field within a foreach for another taxonomy
- new custom filed not showing in taxonomy
- Connect ACF field + custom taxonomy [closed]
- Adding Advanced Custom Fields to posts
- ACF Field, hide taxonomy title and image when no nothing selected in post
- ACF Custom field not showing in Timber Taxonomy page
- WordPress search form and search result through ACF field in custom taxonomy
- How to show selected check box vendors on front end home page?
- Creating a list with multiple categoreis and options
- Taxonomies, Adanced Custom Fields and Repeatable Fields
- ACF Display Taxonomy Image Field
- Display posts from specific slug of the custom taxonomy in WordPress
- Gravity Forms with Advanced Post Creation Add-On not updating ACF fields on custom taxonomy
- Display category posts grouped by taxonomy
- get_query_var(‘paged’) always returns empty
- Return only the custom sub-term for custom post type, do not echo term-parent
- Connect Users and Taxonomies
- Post tags saving as both tag name & tag ID on post update when tags are displayed as checkboxes
- Retrieving custom taxonomy in order, but excluding specific tax IDs
- Sort Custom Taxonomy Terms in admin by custom order
- Display sub-taxonomies based on SELECTED parent-taxonomy
- Checking if a Page has an Associated Term?
- How to redirect custom post type archive to first term of associated taxonomy?
- Refresh Taxonomies
- Get Bottom Most Level Taxonomy Terms?
- Displaying custom taxonomy terms active trail
- List Recent Post Titles from Custom Taxonomies?
- Get taxonomy parent using child slug (from merged taxonomies)
- Creating a custom search form
- One query to get posts and their taxonomy terms
- Conditional display for custom fields/taxonomy
- How do I keep the page I’m on within the URL when running a search on a taxonomy?
- problem in taxonomy-{taxonomy}.php pagination
- wordpress testimonials
- List Posts For Terms Of A Custom Taxonomy For Any Post Type
- Query posts from a child taxonomy term id
- get_terms() duplicate first term of a custom taxonomy
- Retrieving only custom post types with two required terms (from diferente custom taxonomies each)?
- Best structure for entering recipes in a WordPress theme?
- Is this the proper way to get a taxonomy description into a post template?
- Custom taxonomy link automatically removing query string and re-directing
- Get name of taxonomies of current page
- Custom taxonomy filter for media
- export and import taxonomy terms from one taxonomy to another
- Find terms in a custom taxonomy based on the hirearchy
- WooCommerce custom taxonomy as meta?
- Query custom taxonomy for category including children
- SQL / wp_update_post: change post custom field to CPT post taxonomy
- Get 1st parent category id from post
- Filter by Custom Taxonomy AND Custom Field
- Custom Permalink Structure for terms/taxonomies of custom post type
- register_taxonomy for both ‘Post’ & ‘Page’
- Display custom taxanomy on woocommere product page
- when custom taxonomy is empty, the page won’t load
- How to structure all custom-taxonomy with three verbs(a,b,c) and route them accordingly?
- how do you pull data from two taxonomies?
- problem : Custom taxonomy template not showing
- register_taxonomy_for_object_type (images) : how to use it ?
- Restrict user to terms in a custom taxonomy registered for both posts and users
- Exporting Custom Taxonomy Description without Plugin
- How do I display post count of a custom post type with custom category taxonomy in wp_menu_nav?
- WordPress Main Menu with dynamic url
- wp_insert_post and custom taxonomy
- WordPress tag or archive php file customization
- Dynamic value for get_option linked to taxonomy term_id?
- Best Method to Switch Between Terms (Custom Taxonomy)
- If page is a taxonomy do X, if is a term, do Y
- Getting the parent terms adds additional empty markup [closed]
- How to query authors by custom taxonomy?
- Custom taxonomy list in two columns
- get multiple values from $_GET from multiple checkboxes
- Using wp_query is it possible to orderby taxonomy?
- Way to organize content – custom taxonomies or other way?
- Using post type archive page for taxonomy archive
- Taxonomy archive link from term id
- Taxonomy to display form after creation
- How home my code doesn’t display any feature image? Looping through post from a taxonomy and not getting feature images back
- Add taxonomy fields of posts into RSS feed
- Add text in custom taxonomy