 lukasM
|
Hi,
im using a custom post type for store locations in 3 languages.
When i switch the site to RU im still getting 'store_country' in EN.
Do you know why?
$args = array(
'post_type' => 'stores',
'posts_per_page' => -1
);
$stores = new WP_Query($args);
$countries = array();
while ($stores->have_posts()):
$stores->the_post();
$store_country = get_field('store_country', get_the_ID());
$countries[] = $store_country //should be RU not EN;
endwhile;
|
 Dražen
Supporter
Languages:
English (English )
Timezone:
Europe/Zagreb (GMT+02:00)
|
Hello,
can you please try to use our wpml_object_id hook to get the translated ID:
- https://wpml.org/wpml-hook/wpml_object_id/
Example:
get_field( FIELD_NAME,apply_filters( 'wpml_object_id', get_the_ID(), 'page', TRUE,'en' );
Regards,
Drazen
|