Home Forums ACF PRO Get_field specific langage


Get_field specific langage

    • Gil

    • January 12, 2019 at 10:42 am

    Hi, I have a custom field to insert an special image in products (woocommerce) , i use WPML for translation. This image should be the same for every languages, i tried to copy the acf group and field in all langages without any success. Maybe i should just retrieve the main langage info in the template ? i have this code:

    <div id=”bandeau-produit” class=”mx-0 mb-3″ style=”background-image:url(<?php echo get_field(‘bandeau_image’) ?>)”>
    is there a way to retrieve the french version whatever the langage ?


    • kwaves

    • February 9, 2019 at 2:38 pm

    This could help:

    If not: if French is the default language, you could try modifying the example from this comment to work with page-level fields instead of global options, and rename it from get_global_option() to get_french_field() or something to that effect. If French isn’t the default language, you’d probably just need to modify the output of cl_acf_set_language().

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.