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.

This topic contains 10 replies, has 2 voices.

Last updated by Izzi Hassan 3 weeks, 2 days ago.

Assigned support staff: Izzi Hassan.

Author Posts
September 26, 2019 at 6:45 am #4643743

shaunT-3

i need to get same acf data in two language

September 26, 2019 at 10:26 am #4645695

Izzi Hassan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for reaching out to us. Translating ACF data is supported by WPML and you can find a lot of information about it in our documentation. You should be able to translate or duplicate fields created with ACF and access the content in both languages.

If you have already started translating your ACF fields and are looking for a way to show the same content in both languages, you can set your ACF field to duplicate the original content by following the instructions below and selecting “Copy” from the translation options:
https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/#making-acf-fields-translatable

If you are just starting out with ACF and WPML, here is a link to the information you should read:
https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/

You will need to download and install the Advanced Custom Fields Multilingual plugin from your Downloads page before you can begin translating ACF fields:
https://wpml.org/account/downloads/

Please read through the documentation and follow the steps in a test site to start translating your ACF fields.

Don’t hesitate to reach out if you have any issues!

September 26, 2019 at 11:18 am #4646049

shaunT-3

yes, but I need one place for entry & show this entry on two language page.
no need to add a double entry in both of language page

September 26, 2019 at 1:23 pm #4647185

Izzi Hassan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

If you set the custom field translation option to "Copy", you will not need to duplicate the content manually for that field on translated posts. You can make it always use the original content by following the instructions below and selecting “Copy” from the translation options:

https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/#making-acf-fields-translatable

Please note that you want to use the “Copy” option and not the “Copy Once” option. Copy Once will mean that if you update the original post, the translated post’s custom field will not update automatically.

Please let us know if you are able to get the custom field to duplicate automatically.

September 27, 2019 at 10:45 am #4653553

shaunT-3

yes used “Copy” option but when updating on one acf field data update it's not automatically updated on another language.

September 27, 2019 at 1:14 pm #4654407

Izzi Hassan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

In that case, we will need some more information to figure out what is happening. As a first step, please enter your debugging information into the fields below. I have enabled debug information:
https://wpml.org/documentation/support/debugging-wpml/#how-to-send-us-bug-reports

Please also tell us exactly which custom field is not working properly.

Once we look at your debugging information, I will provide further instructions to identify and solve the problem.

September 30, 2019 at 5:55 am #4662429

shaunT-3

I set up the ACF plugin for this site & I get the ACF data from English site to all other site but it's not working, I used "Relationship" ACF field type in this site
In the English site, Array data is coming but not in the other languages

September 30, 2019 at 6:48 am #4662503

Izzi Hassan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

From your debug information, I can see that you have not installed the Advanced Custom Fields Multilingual plugin. Please go your "My Downloads" page and scroll down. You will find a download for the plugin as shown in the Screenshot 1:
https://wpml.org/account/downloads/

Next, please confirm that your ACF Field groups are set to "Translatable". You can do this by following these steps:
- Go to WPML -> Settings
- Scroll down to the "Post Types Translation" section
- Set the option for "Field Groups (acf-field-group)" to "Translatable - use translation if available or fallback to default language"
- Click Save

Next, we need to make sure your ACF Field "select_playerasia" is set correctly. You can do this by following these steps:
- Go to WPML -> Settings
- Scroll down to the "Custom Fields Translation" section
- Set the option for "select_playersasia" to "Copy"
- Click Save

Now the field should behave as expected. If it does not, please respond to this message with temporary access credentials to your site. These credentials will be sent to us securely and privately.

I prefer not to make any changes directly to your website but it is always a good idea to take a backup of your database before sharing your credentials.

September 30, 2019 at 8:24 am #4662853

Izzi Hassan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

It appears my screenshots did not upload. Please find them below.

September 30, 2019 at 1:43 pm #4664967

Izzi Hassan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

I took a look and saw that your Field Group was not translated. I have duplicated it for the "Select Players" Field Group so that those fields show up for all translated posts and pages.

The issue here is not that the field is not duplicating, what is happening is that you are trying to output the content of that field for a specific post, in your template file:

$select_players = get_field('select_playersaia' , 99);
//echo 'vgg';
print_r($select_players); 

'99' is the ID for this post:
hidden link

Because Page '99' is an English page, the custom field does not return any data on non-English pages.

Try changing your template code to get the custom field data for the current page, not Page 99, using a function like get_the_id():
https://developer.wordpress.org/reference/functions/get_the_id/

Let us know if this resolves your issue, and don't hesitate to reach out if you are still unable to see the custom field data show up on your translated pages.

September 30, 2019 at 5:13 pm #4666825

Izzi Hassan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Please try replacing your template code with:

$select_players = get_field('select_playersaia' );
//echo 'vgg';
print_r($select_players);