ACF category field in single template

hello.

with ACF i added color field to default post category. in loops or on archive templates, i can give category name that color with dynamic content.

however, on a single post template, it doesn’t fetch the color. What could be the issue?

Not sure what you’re trying to achieve, by the way, but have you already tried using the Raw > Dynamic Data option?

@Binu yes, i use dynamic data. Situation is like this:
-with ACF i added custom field to my posts categories (it is a pet blog), so each animal category has it’s color.
-i want to use this color on category name on archives, single posts etc.
-when i use dynamic data on category archive, it fetches the color. for exmaple, dogs category
-but on single artciles, i fetch color the same way but color is not displays.

you can see images.


easy because you need to loop your terms to get your TERM CUSTOM FIELDS not post custom fields


on this case I am adding post type loop but for single page syou dont have to just loop your terms mark as current post
image

So, i have to create term loop inside post loop?

this example is from my archive you dont need to create post loop on single since you are already looping post data default :slight_smile:
just focus on terms loop understand the logic

1 Like