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 ?
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.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
So excited to see how well ACF @wp_acf and WP Gutenberg blocks work together! Coded my own custom Gutenberg block for a book list page with book image, author and description fields! SO easy to add on and update with new books now! #wordpress#momswhocode#blacktechtwitter