Support

Account

Home Forums General Issues get_the_terms() don't retrieve custom fields Reply To: get_the_terms() don't retrieve custom fields

  • You need to loop the taxonomies and in doing so, get the taxonomy ID

    Once you have that, you can access the custom fields you store against the taxonomy.

    Something like:

    <?php if( $contacts = get_terms( array( 'taxonomy' => 'contact' ) ) ) :
    foreach( $contacts as $contact ) : 
    	$email_du_contact  = get_field('email_du_contact', 'term_' .$contact->term_id  );?>
    	<?php echo $email_du_contact; ?>
    <?php endforeach;      
    endif;
    ?>

    Code untested