Support

Account

Home Forums Front-end Issues Get Custom Taxonomy Field Value Reply To: Get Custom Taxonomy Field Value

  • Hi @blin

    You say that you have used a taxonomy field to select a taxonomy. Is this a single or multiple select field?

    To get the selected taxonomy term, you use the get_field function like so:

    
    $term = get_field('taxonomy_field_name')
    

    Then,make sure you have a return format setting of ‘Object’ instead of ‘ID’.

    You can then use $term to load data from the taxonomy term like so:

    
    <?php 
    
    // load thumbnail for this taxonomy term
    $thumbnail = get_field('thumbnail', $term->taxonomy . '_' . $term->term_id);
    
    ?>
    

    Thanks
    E