I
I
igix2018-06-14 22:36:21
Landing pages
igix, 2018-06-14 22:36:21

ACF + Repeater, WPML - how to display translated text?

Kind.
Planted landing (1 page) on WordPress.
Installed plugins ACF + Repeater, WPML + string-translation + translation-management.
There is a slider with an image and text. Text and images must be added through the admin panel.
In ACF I made 2 fields through Repeater (test and picture). Everything works fine, the fields are displayed, the slider shows both the picture and the text.
Next, you need to set up the translation of the text using the WPML plugin from Russian to English.
In WPML, I copy the image fields, and translate the text fields (everything is standard).
When I switch the language to English, there are pictures and text in the slider, but the text is WITHOUT translation, i.e. in Russian. Text fields that are made in ACF without the Repeater addition, with simple fields - are translated!
How to force when switching the language to change the translation of the text that is output from ACF + Repeater?
I output data from ACF + repeater through the code below (from off site)

<?php if( have_rows('reviews', 10) ): ?>

          <?php while( have_rows('reviews', 10) ): the_row(); 

            // vars
            $reviews_image = get_sub_field('reviews_image');
            $reviews_text = get_sub_field('reviews_text');
            ?>
              <div class="img" style="background-image: url('<?php echo $reviews_image; ?>');"></div>
              <div class="text"><p><?php echo $reviews_text; ?></p></div>

          <?php endwhile; ?>

    <?php endif; ?>

id10 - main page
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Shilov, 2018-06-15
@Olivoin

I strongly recommend using the Polylang plugin, there will be no such jambs with it. If they didn’t go far, then it’s better to rewrite, I myself recently raised 2 multilingual projects with ACF and did not regret a bit

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question