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?
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.