It works fine for me in the latest version.
Are you sure that you’ve set the color? Because it doesn’t show the default color, only the specifically selected category color.
I tested in a query loop and also on the single archive page and both work great.
just like @jstneti said, can you please check if the color is picked. You can also test this by outputting in basic text element (in content), and see if the color code is outputted.
I got some more info and the issue is not on the Archive page or in a term query, but with the post query.
If I got it right, OP wants to show category names with their respective background color (ACF field) inside a post query.
Here is a solution (custom function) I came up with to achieve that (assuming there is only one category per post) if anyone is interested:
function output_term_color($post_id){
// Return if no post_id is set
if (!$post_id) {
return;
}
// Get the first category from the post
$term_id = get_the_category($post_id)[0]->cat_ID;
// Get the ACF value for this term
return get_field('color_field', 'category_' . $term_id);
}
Ok, I tried everything, but cant do it.
Its a simple post query (NOT ARCHIVE), where i want to coloring the categories term text.
I set up all of categories invidual colors.
I tried in typo > Raw - dynamic color
And tried Attributes > Style - color:{myafccolorfield}
Like I wrote in my last reply, it doesn’t work in the post query. If you need it before it gets fixed, you can use my solution with a custom function (from my my last reply).
Hi Matej!
I tested is lots of, and have read jstneti comments.
Yes I found too, my request is working like a charm, if I make it in Archive page. In the simple query loop (example in frontpage) not working.