From my understanding it looks like it should work if if I use get_queried_object(), however I’m not having much luck.
Here is my code:
<?php $producers_assessment_object = get_queried_object();?>
<?php the_field(‘badge’, ‘producers_assessment_’ . $producers_assessment_object->term_id); ?>
If I manually put in the post ID like so the field works as I would like it to.
I’ve tried using this code below from another SO questions, just to see if I can the term Id in anyway and this also didn’t work.
$cate = get_queried_object();
$cateID = $cate->term_id;
Read more here:: Can’t get taxonomy ID for each post on archive page