How to insert Google translate into your website (WordPress)
There're two important things: 1. where to insert? 2. what's the code
In WordPress, find the Appearance, and then click Edit Themes, and then click the location you want to insert. for example: insert the language translate at the Footer.
the codes as below:
<div id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'zh-TW'}, 'google_translate_element');
}
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
then click update now. you will get a dropdown list at the left bottom.
Tips:
The yellowhight zh-TW code is your default language of your website, I am using TaiWan Chinese codes. yours maybe different.
Comments
Post a Comment