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>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.