Support

Account

Home Forums Front-end Issues Loop Custom Taxonomy Fields with ACF Reply To: Loop Custom Taxonomy Fields with ACF

  • Hi Rociopts. thank you very much. I could solve it I leave the code for other people who can not find a solution.

    <div class="lista-taxonomia"> 
    <?php $types = get_terms( array( 'taxonomy' => 'nombre-de-la-taxonomia', 'hide_empty' => true, ) );
    foreach($types as $type) { ?>
    <div class="otra-div">
    <?php $image = get_field('nombre-del-campo-de-imagen', 'nombre-de-la-taxonomia_' . $type->term_id . '' ); 
    if ( has_term( $type->term_id, 'nombre-de-la-taxonomia')) {
    echo '<img class="imagenes" src="' . $image['url'] . '" /> ' . '<p>'. $type->name . '</p>'; 
    } ?> </div> <?php } ?>
    </div>