Get title color from category custom field

In the documentation, it looks like you can provide the term object to get_field(), however I’ve tended to use either taxonomy_#termid or term_#termid for example

$color = get_term('color', 'category_1234);

or

$color = get_term('color', 'term_1234);

If those down’t work, then I’d check:

  • That your ACF field name is definitely color (and not colour, as I
    would write – being in the UK) and also worth doing a
    print_r($term); or var_dump($term);
  • To make sure you have a WP_Term object
  • Check $colour using print_r or var_dump again, and
    see what you’re getting back