
- Wordpress add language switcher to menu how to#
- Wordpress add language switcher to menu update#
Many browsers have additional option “Preferred Languages” or have a way to sort the languages by preference. # On the first visit of my site with home URL, I get other language than the browser’s displayed one, even after I cleared all the cookies. In most of the cases, they would simply need to remove that extra code, otherwise Integration Guide may help.
Please, ask the authors of those themes and plugins to update their code, if you encounter one of those cases. That multi-line framework is now replaced with Language Switching Buttons (LSB). This function used to deal with multiple input lines per language, which qTranslate-X does not use anymore. Note: Function qtrans_modifyTermFormFor, which some older themes or plugins call directly, is no longer available and should not be needed with qTranslate-X. This ensures compatibility with other plugins and themes that used direct calls to qTranslate methods in their code. However, once the plugin is running and all other conflicting plugins are disabled, you can turn on option “Compatibility Functions” and a number of former qTranslate methods with prefix qtrans_ become available again. That is why all functions with prefix qtrans_ were renamed to have prefix qtranxf_. WordPress policy prohibits use of the same function names if they already defined in other plugins, since this possibly leads to user-unfriendly fatal errors. # I used to make direct calls to one of qtrans_* functions in my theme/plugin, but now those functions are not available. The visual appearance of such menu items can be designed any way as desired, like any other normal menu item.
Build a few custom menu items, each of which switches the current page to a specific language. Refer to the documentation of function the_widget for more information. Read help text to this option on widget admin page.įor example, the_widget('qTranslateXWidget', array('type' => 'both', 'hide-title' => true) ). ‘format’ – string value of custom format, in case ‘type’ is ‘custom’. Type ‘custom’ is only available in version 3.4.6 or later. ‘type’ – string value with possible values ‘text’, ‘image’, ‘both’, ‘dropdown’ and ‘custom’. ‘title’ – string value of widget title. ‘hide-title-colon’ – boolean value, default is ‘false’. ‘hide-title’ – boolean value, default is ‘false’. ‘widget-css-off’ – boolean value, default is ‘false’. Argument #instance takes the following keys: Use a call to WordPress method “ the_widget('qTranslateXWidget', $instance, $args)“. ‘id’ – id of widget, which is used as a distinctive string to create CSS entities. Read help text to this option on widget admin page. ‘format’ – needs to be provided if ‘type’ is ‘custom’. ‘type’ – one of the values: ‘text’, ‘image’, ‘both’, ‘dropdown’ and ‘custom’, which match the choices on widget admin page. A single argument $args is a hash array of options, which accepts the following keys: Starting from the version 3.4.6, the arguments of the function are changed (compatibility with old way is preserved): qtranxf_generateLanguageSelectCode($args). You can change the look of language select list via CSS entries. Argument $type currently accepts ‘image’, ‘text’, ‘both’, and ‘dropdown’ choices, which match the choices available in “qTranslate Language Chooser” widget. Use direct call to qtranxf_generateLanguageSelectCode($type,$id) in your templates (pay attention to prefix ‘ qtranxf_‘ instead of ‘qtrans_’). It has a few customizable options as described in other FAQ topics or embedded help text. Add widget “qTranslate Language Chooser” to an appropriate widget area on your site. It has a few customizable options as described in the embedded help text at menu configuration page or in other FAQ topics. Add menu item “Language Switcher” to an appropriate menu on your site. # What language switching methods are available at front end? If you are a native speaker of that language, consider sending us the information to be included permanently in the plugin configuration. If yours is not included, you can easily add it through the Language Manager ( /wp-admin/options-general.php?page=qtranslate-x#languages). Yes, all languages are supported and more and more get included. If you have integration issues, please read Integration Guide to find out how to integrate your theme or a 3rd-party plugin with qTranslate-X. If you think you encountered a bug, please follow the Troubleshooting Guide and then report it providing step-by-step instructions how to reproduce the problem, preferably starting from a fresh standard WordPress installation.
If you are new to qTranslate-X, please, read Startup Guide.