Support

Account

Home Forums Front-end Issues Display front-end custom field (image) for taxonomy Reply To: Display front-end custom field (image) for taxonomy

  • What version of ACF are you using?

    
    // ACF >= 5.5.0
    $queried_object = get_queried_object(); // gets the term
    $post_id = 'term_'.$queried_object->term_id;
    $image = get_field('image_field_name', $post_id);
    
    
    // ACF < 5.5.0 - will also work on >= 5.5.0
    $queried_object = get_queried_object(); // gets the term
    $post_id = $queried_object->taxonomy.'_'.$queried_object->term_id;
    $image = get_field('image_field_name', $post_id);
    

    for more information see the section on getting field values from different objects on this page https://www.advancedcustomfields.com/resources/get_field/