This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing an issue where ACF fields are displayed in all languages on the homepage for 'Services' and 'Testimonials' custom post type modules. The fields are not correctly configured to display only in the intended language settings. Solution: First, ensure that you are following our guide on working with ACF, which can be found here: https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/. Next, verify that you have the ACF Multilingual plugin installed and updated to its latest version. This plugin is essential for managing the translation of ACF fields. Modify your code to include the 'suppress_filters' => false parameter to ensure that WPML can apply the necessary language filters. Here is the corrected code snippet:
If these steps do not resolve your issue, or if the solution provided here becomes outdated, we recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket at WPML support forum.
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.
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?
-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):
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:
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:
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.--
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.
Thanks for your help; setting up the old config, and adding this code line to get_posts array finally solved it (" ... 'suppress_filters' => false,...");
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.