Support

Account

Home Forums General Issues How to display default language Options field, when no WPML translation exists Reply To: How to display default language Options field, when no WPML translation exists

  • Hi @infoamitywebsolutions-co-uk

    In this kind of situation, you can change the current language before the repeater code instead. Should be something like this:

    <?
    
    <?php
    add_filter('acf/settings/current_language', function(){return 'en';});
    
    if( have_rows('enquire_link', 'option') ):
        while( have_rows('enquire_link', 'option') ): the_row();
    ?>
            <a href="<?php the_sub_field('link'); ?>" class="enquire-button">
                <?php the_sub_field('text'); ?>
            </a>
    <?php
        endwhile;
    endif;
    
    add_filter('acf/settings/current_language', function(){return 'de';});
    ?>

    But I think the best way would be copying the saved data from options_field_name to options_de_field_name.

    I hope this makes sense 🙂