Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 6 replies, has 2 voices.

Last updated by maxL-15 4 years, 7 months ago.

Assisted by: Riffaz.

Author Posts
August 26, 2019 at 9:33 pm #4461571

maxL-15

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?

August 27, 2019 at 4:46 am #4462795

Riffaz

Hi,

Thank you for contacting WPML support.

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 
	}
}

Let me know how it goes.

Regards,
Riffaz.

August 27, 2019 at 7:52 am #4463467

maxL-15

It's about HTML code. Where do I paste the code above?

August 27, 2019 at 8:31 am #4463711

Riffaz

Hi,

The above code should go to functions.php

What you are trying to do with your HTML code?
Where do you have it now?

August 27, 2019 at 10:14 am #4464939

maxL-15

It is for the trustedshops reviewwidget in the right corner bottom of the NL site.

It is now in a plugin called Custom CSS HTML

August 27, 2019 at 12:39 pm #4466647

Riffaz

Hi,

Thank you for the details

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.