Advanced Custom Fields (ACF) allows you to add custom fields to taxonomies, enhancing your taxonomy terms with additional information or data. With WPML, you can translate both your taxonomies and the custom fields added to them.
From ACF → Field Groups, you can create a field group with the custom fields of your choice and set it to appear on specific taxonomies, such as categories, tags, or even custom taxonomies.
When you create or edit a taxonomy term, you’ll find the custom fields available for input. You can use these fields to provide specific information or data related to that term.
For example, in a cooking blog, you might have a custom taxonomy called Cuisine with terms like Italian, French, or Chinese. By adding custom fields like Common Ingredients to this taxonomy, you can provide more detailed information about each cuisine type.
Setting Up Field Groups for Translation
When you create your field group in ACF → Field Groups, the ACFML Multilingual Setup prompts you to choose a translation option for your field group. The option you select depends on your custom field types and influences how you translate the custom fields attached to your taxonomy.
Translating Text-Based Custom Fields Assigned to Taxonomies
As an example, let’s say you have a Cuisine taxonomy on a recipes blog and you want to attach a Text or Text Area field to it and list some popular dishes from each cuisine. Or, maybe you want a WYSIWYG field to suggest beverage pairings for a particular cuisine.
For field groups with these textual field types, you can select the Same fields across languages option. This makes your custom fields available for translation from WPML →Taxonomy translation.
When you translate your taxonomy term, you’ll be able to input the translations for the term name, slug, and the custom fields attached to it.
Translating Other Field Types Assigned to Taxonomies
Let’s say you don’t want to use these text-based types of custom fields with your taxonomy. Instead, you want to attach:
Number field to indicate the average preparation time for recipes within a particular cuisine
Image field to each cuisine to showcase a representative photo or flag of that cuisine