Why do multilingual plugins duplicate page content?

I'm trying to make a multilingual site with a Wordpress CMS, but the plugins duplicate the content for all translations.

I installed the Polylang plugin and create 2 versions of the main page in Ukrainian and English. When editing the content of one page, for example, the Ukrainian language, these changes are for some reason duplicated in other locales as well. I.e. when you go to the main page of other languages-there is the content of the Ukrainian version. So everything changes in the editing of these paged paged.

The information is filled in in the custom fields of the ACF plugin. It turns out that the values of the ACF fields are duplicated.

I tried to install the WP Globus plugin, WP Multilang-the same thing.

What could be the problem ? This happens only with content that is filled in via custom fields. Content filled in through the standard fields is correctly translated.

Read, like all plugins corretno work with ACF, then what could be the reason ?

Author: dv1zhok, 2020-02-25

2 answers

To translate ACF fields, you need Polylang PRO or WPML with an additional ACFML plugin.

 0
Author: KAGG Design, 2020-02-25 15:55:24

I found a solution, everything turned out to be outrageously simple:

If before multilingualism, ACFs were output via the construction:

<? the_field('some-field', ID); ?>

Where ID is the ID of the page from which the value is taken.

Then when translating other pages, they have different IDs (which is logical). The design above just needed to be reworked into the following:

<? the_field('some-field', pll_get_post(ID)); ?>

Where ID is the same page (which is taken from the main language).

This will allow you to output the associated version of the page for the desired language, as well as the information we need.

 0
Author: dv1zhok, 2020-02-26 07:23:48