Support

Account

Home Forums General Issues Query taxonomy for fields Reply To: Query taxonomy for fields

  • Hi Jonathan and thanks for the answer.
    I don’t know how to create custom walker.

    So maybe I’ll try this way:

    
    $current_term = get_queried_object();
    $args = array(
        'parent' => $current_term->term_id,
        'orderby' => 'slug',
        'hide_empty' => false
    );
    $child_terms = get_terms( $current_term->taxonomy, $args );
    $icon = get_field('icon', $current_term->taxonomy . '_' . $current_term->term_id);
    $image_thumb = $icon['sizes']['full'];
    echo '<ul>';
    foreach ($child_terms as $term) {
        echo '<li><h3><a href="' . get_term_link( $term->name, $current_term->taxonomy ) . '">' . $term->name . '</h3></a></li>'; 
    	echo '<img src="'.$image_thumb.'" class="icon">';
    }
    echo '</ul>';
    

    But this code gives me only the names and not images…
    What’s wrong?