Using these instructions (from section „How to use in your theme functions” in functions. Give the menu a name, make sure the Language and Translation of options are correct, select the proper display location from Menu Settings and proceed to add. We could either add the shortcode directly in the header.php or the includes > helper-main-menu.php file, or use the available hooks inside the mentioned template. Searching on google how to modify and style the language switcher used in WPML plugin there is an useful link showing how to build your own custom language switcher. There is a shortcode called wpmllanguageselectorwidget that we could use to display the language switcher inside the header beside the mobile menu. The initial code for displaying the menu was: wp_nav_menu(array('theme_location'=>'topbar','menu_class'=>'nav container-inner group','container'=>'','menu_id' => '','fallback_cb'=> false)) Customize the language switcher: You can customize the language switcher to match the design of your site. Decide which languages you want to add based on your target audience and the regions you want to reach. From the list of languages select the required ones and click on save. One client wanted the language switcher (with two languages, Romanian and English) to be on the second position in menu and to show just the inactive language. Navigate to Dashboard RealHomes Customize Settings Floating Features and look for WPML Language Switcher panel. Select the languages you want to add: The language switcher plugin will allow you to add multiple languages to your site. For this, visit Dashboard > WPML > Languages > Site Languages > Add / Remove languages. This article will present a method to display a custom language switcher in the desired position in menu when using WPML plugin for WordPress. description: This action hook allows controlling the language in WordPress queries.
0 Comments
Leave a Reply. |