We have a Trusted Shops widget for reviews etc. We have custom codes in every language. Can I show another code in the German language than the Dutch one?
You did not mention what code you are using or where you are using it.
Typically in WordPress you have to follow this format to use different code for different languages.
<?php
add_action( 'wp_head', 'my_custom_js' );
function my_custom_js() {
if(ICL_LANGUAGE_CODE=='en'){?>
<!--- your code to english--->
<?php } elseif(ICL_LANGUAGE_CODE=='de'){?>
<!---your code to german--->
<?php
} elseif(ICL_LANGUAGE_CODE=='fr'){?>
<!---your code to french---
Global site tag (gtag.js) - Google Analytics -->
<?php
} elseif(ICL_LANGUAGE_CODE=='es'){?>
<!---your code to spanish--->
<?php
}
}
Where do you have your HTML code now?
In the theme options? in any widget? in functions.php?
The widget works in NL site now, right? for that where did you add the HTML code?
Let me know.
Regards,
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.