Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Elementor users - please update WPML to the latest version to maintain compatibility. More details here - https://wpml.org/changelog/2024/12/wpml-4-6-15-critical-update-for-elementor-sites/
Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - -
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - -

Supporter timezone: Asia/Jerusalem (GMT+02:00)

Tagged: 

This topic contains 5 replies, has 0 voices.

Last updated by Itamar 2 days, 3 hours ago.

Assisted by: Itamar.

Author Posts
December 24, 2024 at 2:50 pm #16544048

ianA-14

Background of the issue:
I'm getting the ACF services custom post type in both English and Spanish languages for the Homepage 'Services' custom post type module, and 'Testimonials' one (both content blocks). I tried many things without any results. One of the many configurations I tried was this one posted by support here: https://wpml.org/forums/topic/acf-fields-are-shown-in-all-languages-and-acf-fields-dont-save-because-of-it/

Symptoms:
ACF fields are printed in all languages (HOMEPAGE).

Questions:
Why are ACF fields showing in all languages?
How can I configure ACF fields to display correctly in each language?

December 25, 2024 at 1:04 pm #16545435

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

Can you please confirm you are following our guide on working with ACF?

https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/

Do you have our bridge plugin ACF Multilingual installed and updated to its latest version?

What code do you use to output the fields to the front end?
Can you please share it?

If you need further help with this issue, please share your site's Debug information. You can read about it here.

http://wpml.org/faq/provide-debug-information-faster-support/

Regards,
Itamar.

December 27, 2024 at 9:34 pm #16549376

ianA-14

Yes to all;

-The Services are shown in the homepage by activating ( from WordPress pages section) an ACF 'True / False' toggle button called 'toggle-services', that has been created inside the ACF 'Modules' Field Groups; ( at the backend it belongs to the '$toggleServices variable' )

That ACF true/false field is set as 'Traslate' (inside the ACF Fields 'Modules' group), and the Services Fields Group is set as 'Same fields across languages';
The 'True/False' acf field is the one that allows the 'Services' to be shown, from the Home page set up/config.;

-The code that has been used to show up the Services in the homepage is the following (I believe this could be the problem here):

"
$services = get_posts(array(
'posts_per_page' => -1,
'post_type' => 'services',
'order_by' => 'post_title',
'order' => 'asc',
'post_status' => 'publish'
));
// print_r($services);
if ($services && $toggleServices) :

...
foreach ($services as $service) :
$icon = get_field('icon', $service->ID);
$link = get_the_permalink($service->ID);
$name = get_field("name", $service->ID);
// Show the Icons and each Icon name...
?>
...
"

Thanks in advance!!
(I attach some screenshots)
Kind regards

Screenshot 2024-12-27 183259.png
Screenshot 2024-12-27 183145.png
Screenshot 2024-12-27 183047.png
Screenshot 2024-12-27 182215.png
December 28, 2024 at 9:34 pm #16550552

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

Thanks for providing this information. However, I'm confused. You wrote the Services Fields Group is set as 'Same fields across languages'. This option should not allow you to set the translation preference of the fields. Nevertheless, the screenshot shows that you set the True/False field to 'Translate'. In any case, this is the wrong setting for this field. It should be set to 'Copy'. Please check our guide about the different fields' settings in the Expert mode here:

https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/recommended-custom-fields-translation-preferences-for-acf-and-wpml/#choice-fields

Please check the True/False setting to 'Copy' and try again. You will need to update the page and its translation.

Regards,
Itamar.

December 30, 2024 at 3:11 pm #16553614

ianA-14

Hi, thanks for your answer anyway, but this still not working (I updated the page and its tranlation too without results);

I attach here again all the configurations I have, so you can have a cleaner view of what I'm doing wrong, or why is this marvelous plugin printing the services in both languages on the front-end;

Thank you again for your help!

My configuration so far is (I attach all the screenshots, with their labels on them...):

-Acf 'True/False Button Field: this is set as 'Copy' now; this is the toggle button in charge of showing the services on the hompage (by activating it and turning it on).

-Acf 'Services' field groups set as 'Same Fields across Languages';

-Homepage settings: now that the 'True/False' button has been changed to 'copy', is not allowing me to use it in Spanish language (shows a padlock, so I can not deactivate it if needed...);

-Back-end code for printing the Services on the page:

"
$services = get_posts(array(
'posts_per_page' => -1,
'post_type' => 'services',
'order_by' => 'post_title',
'order' => 'asc',
'post_status' => 'publish'
));
// print_r($services);
if ($services && $toggleServices) :

...
foreach ($services as $service) :
$icon = get_field('icon', $service->ID);
$link = get_the_permalink($service->ID);
$name = get_field("name", $service->ID);
// Show the Icons and each Icon name...
?>
...
"

*Please let me know if you need any other info, or if I should create another ticket to be reviewed and have second eyes on this by someone else.

WPML services post type config.png
Homepage ACF Services activation button.png
Acf True false button.png
Acf Services Field Groups.png
December 31, 2024 at 10:00 am #16555314

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

I'm going to consult our second-tier supporters about your case. I also wanted to ask for access to your site to check things directly on your site, but I can see it is on a local server.

Do you also have this site online, and can you share access with me?

If so, please share the access details to your site with me. I'm enabling a private message for the following reply.
Privacy and Security Policy
We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/
**IMPORTANT**
- - Please backup the site files and database before providing us access. --
-- If you have a staging site where the problem can be reproduced, it is better to share access to the staging site.--

Regards,
Itamar.

January 1, 2025 at 10:31 am #16556676

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

Our second-tier supporter says that based on the information we have, it is hard to guess the problem. He suggest we to try and replicate this problem on a sandbox site. Then, I'll be able to escalate it to our compatibility team. For this, I created a test website with a clean WordPress install. You can access it through this link:

hidden link

With this link, you'll be directly logged in.

I already installed WPML and configured it to have English as the default language and Spanish as the second language. I also installed ACF Pro. You can use the WP File Manager plugin to insert your custom code.

Please let us know when everything is finished, and you can replicate the problem.

Important! Do not import your site to the test site. We must replicate the problem on a fresh, clean WordPress installation.

Regards,
Itamar.

January 2, 2025 at 4:16 pm #16559492

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, and thanks for the access details.

I've passed the access information to our second-tier supporter. I'll update you here once I have a reply from him.

I appreciate your patience.
Itamar.