Support

Account

Home Forums General Issues How to add custom field to a category? Reply To: How to add custom field to a category?

  • you need the term ID

    
    $queried_object = get_queried_object();
    
    // ACF5 >= 5.5
    get_field('field_name', 'term_'.$queried_object->term_id');
    
    // ACF < 5.5
    // get_field('field_name', $queried_object->taxonomy.'_'.$queried_object->term_id');