WPML
Status
Resolved
Reported for
WPML Multilingual CMS 4.5.12
Resolved in
4.6.0
Topic tags
Bug

Overview of the issue

If you are using the horizontal list or vertical list display options for any of the language switchers on your site, the order is not consistent when you switch languages on the front-end. Instead, the current language will always be displayed in first position, despite your settings.

Workaround

Please, be sure of making a full backup of your website.


  1. Open the /sitepress-multilingual-cms/classes/language-switcher/class-wpml-ls-model-build.php file.

  2. Look for line 244.

  3. Replace:
    			$ret = $this->order_menu_items( $ret, $this->sitepress->get_current_language() );

    With:

    			if (! $slot->get( 'display_link_for_current_lang' )) {
    				$ret = $this->order_menu_items( $ret, $this->sitepress->get_current_language() );
    			}

All known issues →