I am very newbie with WordPress and editing plugins.

I have a custom menu (English, Chinese (Simplified)) using HTML that I want it to call the gtranslate function for each language but it seems like it does not working. I dont know how to run the gtranslate with my custom menu. Please help.

<li class="li-eng">
<i class="sl-flag flag-usa"><div id="usa"></div></i> 
<span class="active"><?php _e('English', 'gtranslate'); ?></span>
</li>
<li class="li-zh">
<i class="sl-flag flag-de"><div id="chinese"></div></i> <span><?php _e('Chinese (Simplified)', 'gtranslate'); ?></span>
</li>
  • You using some plugin for this or code? – dado Dec 4 at 6:32
  • hi. yes.i am using gtranslate plugin. the plugin widget works fine, but i try to implement their function inside my own custom design html <li> tag. – Luqman305 Dec 4 at 7:08

Link menu item with URL = #, Link Text = Global and add CSS Classes = gtranslate-parent to the newly created menu item. After that you can configure GTranslate and set Widget look = (Flags with language name/Flags with language code/Language names/Language codes) and it will appear as a dropdown when you hover on the newly created menu item.

  • thank you for your response. I believe that your code will work fine with the menu item widget. My menu problem is custom made html menu which we created in backend. But it seems that gtranslate plugin does not translate the menus, titles, category,etc..the menu link when click,will only change the content language. – Luqman305 Dec 4 at 9:18
  • Yes, I didn't get you question first time. I think what you need is possible if you buy pro version of plugin. But for multilanguage site I would recommend to go with free polylang. You can do anything you want and they have great support. – dado Dec 4 at 10:09
  • I see. thank you very much for your time. Yes I change it. I am trying to find another plugin where I can manually translate also the wording. – Luqman305 Dec 6 at 1:47

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.