A
A
Andrey Ivanov2020-02-23 00:07:27
CMS
Andrey Ivanov, 2020-02-23 00:07:27

Why do multilingual plugins duplicate page content?

Good day! I'm trying to make multilingual website with Wordpress CMS, but plugins duplicate 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. Those. when entering the main page of other languages ​​- there is the content of the Ukrainian version. Everything changes in editing these pages.

The information is filled in the custom fields of the ACF plugin. It turns out 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 only happens with content filled through custom fields.
Content filled in through standard fields is correctly translated.

Esteemed, like all plug-ins correctly work with ACF then in what there can be a reason?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Ivanov, 2020-02-26
@dv1zhok

I found a solution, everything turned out to be outrageously simple:
If before multilingual ACF was displayed through the construction: 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 construction above just needed to be changed into the following one: Where ID is the same page (which is taken from the main language). This will display the associated version of the page for the desired language, as well as the information we need.
<? the_field('some-field', ID); ?>
<? the_field('some-field', pll_get_post(ID)); ?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question