Title: [Plugin: mLanguage] Optional mlang-menu
Last modified: August 20, 2016

---

# [Plugin: mLanguage] Optional mlang-menu

 *  [mayeulk](https://wordpress.org/support/users/mayeulk/)
 * (@mayeulk)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-mlanguage-optional-mlang-menu/)
 * Hi,
    I have a blog for which only a few posts are translated in several languages.
   I want to display the mlang-menu only on posts with contents in several languages,
   and only with the relevant languages. It somehow works if I put this in the post
   itself (html view):
 *     ```
       <script type="text/javascript" src="http://localhost/wordpress/wp-content/plugins/mlanguage/mlanguage.js?ver=3.0.5"></script>
       <a class="mlang-menu-link" href="/" data-lang="en">
       <img class="mlang-menu-image" style="outline: medium none;" src="http://localhost/wordpress/wp-content/plugins/mlanguage/img/den.png" alt="English" />
       </a>
       <a class="mlang-menu-link mlang-active" href="/" data-lang="fr">
       <img class="mlang-menu-image" style="outline: medium none;" src="http://localhost/wordpress/wp-content/plugins/mlanguage/img/fr.png" alt="français" />
       </a>
       ```
   
 * HOWEVER, when you first go to the web site, if you click very rapidly to the 
   language button, it goes to the root page of the website (here, to: [http://localhost/](http://localhost/)).
   
   Maybe it is because the mlanguage.js is not loaded yet. If you wait or have already
   loaded mlanguage.js, then it works (until you clear the cache). Any hint on how
   to solve this? Thanks! PS: a bonus would be to have a short code instead of the
   above html code.
 * [http://wordpress.org/extend/plugins/mlanguage/](http://wordpress.org/extend/plugins/mlanguage/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [mayeulk](https://wordpress.org/support/users/mayeulk/)
 * (@mayeulk)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-mlanguage-optional-mlang-menu/#post-2550976)
 * Hi,
    Putting an anchor as the destination of the href somehow works (flag is 
   inneffective until js is loaded).
 *     ```
       <script type="text/javascript" src="http://localhost/wordpress/wp-content/plugins/mlanguage/mlanguage.js?ver=3.0.5"></script>
   
       <a data-lang="en" href="#change_language" class="mlang-menu-link"><img alt="English" src="http://localhost/wordpress/wp-content/plugins/mlanguage/img/den.png" style="outline: medium none;" class="mlang-menu-image"/></a>  <a data-lang="fr" href="#change_language" class="mlang-menu-link mlang-active"><img alt="français" src="http://localhost/wordpress/wp-content/plugins/mlanguage/img/fr.png" style="outline: medium none;" class="mlang-menu-image"/></a>
       ```
   
 *  However, I needed to disable to disable visual editor to avoid WP to strip the
   <script> tag. I solved this installing the “Enhanced Text Widget” plugin and 
   putting the <script> in such a text widget.
 * (Note: I do not want to modify the templates)

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: mLanguage] Optional mlang-menu’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/mlanguage.svg)
 * [mLanguage](https://wordpress.org/plugins/mlanguage/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mlanguage/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mlanguage/)
 * [Active Topics](https://wordpress.org/support/plugin/mlanguage/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mlanguage/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mlanguage/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [mayeulk](https://wordpress.org/support/users/mayeulk/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/plugin-mlanguage-optional-mlang-menu/#post-2550976)
 * Status: not resolved