Home Forums General Issues Category Color Reply To: Category Color

  • Elementor is looking for a field on the post, this field does not exist on the post, it exists on the taxonomy term. Elementor cannot do what you are looking for.

    It this instance elementor does use the ACF function get_field(), this is not the case with all field types. Because of this you can use an acf/format_value filter with a priority of > 10 so that it runs after the built in ACF filter, to alter the value.

    In this filter you would get the terms that the post is assigned to using get_post_terms(). For the post ID your would use get_the_ID(). This will return an array of terms. The you need to loop over this array, event if there is only one, and then get and return the color from the term

    $return get_field('category_color', $term);