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
- ACF – How to get custom taxonomy term image field
- How do I get the top-level terms in a custom taxonomy?
- Which template name to use for taxonomies but not their terms?
- Count number of post in Taxonomy?
- wp_query orderby title and meta key value (WP3.1)
- custom taxonomies on permalink
- Manipulating cookie on specific taxonomy archive page
- Create Admin Only Taxonomies?
- Category page and edit post page with this category very slow
- Custom taxonomies
- Custom Taxonomy tree view not showing correctly in backend
- Add parent/child taxonomy to custom post type url
- Extending wordpress search to include excerpts and taxonomies?
- Adding ‘active’ class to custom taxonomies using walker in functions.php
- How to output content based on same custom taxonomy?
- How to create custom taxonomy URLs without taxonomy name?
- How to add taxonomy to Users menu in admin?
- Category page for custom-taxonomy shows 404 when using custom permalink structure
- How to retrieve category NAME instead of ID in a function with a taxonomy custom field?
- How can i retrieve all custom registered taxonomy?
- How to Put Custom Taxanomy Meta Box in Main Column
- Hook to change Custom Tag Taxonomy Links?
- How to use get_the_terms() to display multiple terms?
- Woocommerce product search result layout page
- Sorting Tags by Slug Value
- List posts of term on term’s admin edit page
- Search functionality in ‘taxonomy postbox’ on edit post page
- Change the permalink URL to include a taxonomy term
- How to limit the number of users who can be added to a user custom taxonomy?
- Get Custom Taxonomy Title by Spesific Sub Category via fputcsv
- Taxonomy Pagination Rewrite
- Set Custom Taxonomy to Entire Site Programatically
- Same term from custom taxonomy in two different custom post types?
- limit post by a taxonomy in the admin
- WordPress Custom post query sorting does not work
- group posts by taxonomy terms
- How to create a custom taxonomy using a shortcode?
- Custom URLs in Custom Search Results
- how to extract the username of the wordpress user?
- WordPress set taxonomy on post?
- Removing “trashed” posts from post count in custom taxonomy terms?
- WordPress sub taxonomy template
- SEO Title Tag and Meta Description for custom taxonomy
- W3 total cache – white screen of death when trying to show certain taxonomies [closed]
- How to get this value inside RETURN
- Comma separator problem of custom taxonomy
- Reorder a page of posts of a certain taxonomy/value by a custom field
- How to display custom post type pagination buttons when processing AJAX request
- List posts with slug title
- Unregistered taxonomy apears still as emtpy filter list
- Use custom taxonomy terms as parent for pages
- Get Highest and Lowest get_term_meta() value from Taxonomy Term
- Custom taxonomies template
- Custom taxonomy archive template not recognised
- Get the terms of a post
- add_rewrite_rule using custom taxonomy and year
- index.php Not Showing Custom Posts / Terms
- How to make my taxonomy URL work?
- Index page of posts tagged with two separate taxonomies
- How to make an sql query to exclude everything but custom taxonomy terms in table wp_terms?
- stdClass::$labels /wp-includes/general-template.php undefined
- Custom taxonomy in short code
- What is the current page’s Taxonomy?
- How do I query multiple specific posts from a custom taxonomy?
- An unidentified error has occurred when deleting a category
- Taxonomy term template is not working