Trying to display custom fields for categories on a category page.
- I added the fields to ACF in the category taxonomy
Added this snippet into my custom category category-emails.php
$image = get_field('header_image', 'category_74'); echo($image);
This works. It renders out the data I have in 'header_image'.
The problem is, category_74
is hardcoded into the template. So it will only show that header_image for category_74. Trying to make it so any category or sub category of category 74 has field 'header_image' available and that I wont have to modify the template.
Is there a way to write something more general, that replaces 'category_74' with something like 'categories'... I tried categories but didn't work.