I am trying to return the url of an icon (implemented with ACF + WPML) from a translated custom taxonomy term:
@php
$terms = get_terms(array(
'taxonomy' => 'parcours',
'hide_empty' => true,
));
@endphp
@if (!empty($terms))
@foreach ($terms as $term)
@php
$id = $term->term_id;
$taxonomy = $term->taxonomy;
$slug = $term->slug;
$name = $term->name;
$image = get_field('route_icon', $taxonomy . '_' . $id);
@endphp
@php echo $image @endphp
@endforeach
@endif
No matter what i have tried (wpml_object_id included). The image variable is empty in the translated site only. The variable is returning the expedted data in the original language and everything is working well. Also the id variable is returning the correct translated id as expected.
Am I doing something wrong in ACF? Thanks a lot for your help.