Hello,
i’m using ACF + WPML + relationship fields.
On a city page, i do list different custom posts types ( like restaurants, hotels, etc… )
In default language ( french (FR) ) everything is OK.
i do list all those items by filtering meta with ID & LIKE.
Classic query, based on ACF doc.
$args = array(
'post_type' => 'restaurant',
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => 'contact_city',
'value' => '"' . get_the_ID() . '"',
'compare' => 'LIKE'
)
)
);
$query = new WP_Query($args);
if ($query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post();
$title = get_the_title();
$permalink = get_the_permalink();
echo '<a href="'.$permalink.'">'.$title.'<a>';
endwhile;
endif;
But when i change language, i do have 0 results displayed. ( posts are translated & published in other languages ).
if i echo get_the_ID();
i get the good ID for each language
( fr = 1104 / en = 1123 )
If i change ‘value’ to 1104, i do have the correct results displayed in every language.
So this mean that my relationship are all based on FR id. How can i manage this ? To set ID as current language ID, or to query ID from FR relationship?
any idea ?