Support

Account

Home Forums Front-end Issues Returning Custom Field Values (including Taxonomy Terms) on Term archive pages Reply To: Returning Custom Field Values (including Taxonomy Terms) on Term archive pages

  • This was almost right

    
    <?php
    $queried_object = get_queried_object();
    $taxonomy = $queried_object->taxonomy;
    $term_id = $queried_object->term_id;
    
    $value = get_field( 'test_field', $taxonomy.'_'.$term_id);
    if( $value ) {
        echo $value;
    } else {
        echo 'empty';
    }
    ?>