WPML
Status
Resolved
Reported for
WPML Multilingual CMS 3.1.9.3
Resolved in
3.2

Overview of the issue

The language switcher in secondary languages adds “…/front-page-slug” to the homepage URL when “a static front page” is set.

Workaround

  1. Locate the “get_ls_languages” function in “sitepress-multilingual-cms/sitepress.class.php”
  2. Find the following code block:
    if($lang_page_on_front && $lang[ 'code' ] != $default_language) {
        $lang_page_on_front = icl_object_id($lang_page_on_front, 'page', false, $lang[ 'code' ]);
    }
    
    if($lang_page_for_posts && $lang[ 'code' ] != $default_language) {
        $lang_page_for_posts = icl_object_id($lang_page_for_posts, 'page', false, $lang[ 'code' ]);
    }
    
  3. Replace it with this:
    if($lang_page_on_front) {
        $lang_page_on_front = icl_object_id($lang_page_on_front, 'page', false, $lang[ 'code' ]);
    }
    
    if($lang_page_for_posts) {
        $lang_page_for_posts = icl_object_id($lang_page_for_posts, 'page', false, $lang[ 'code' ]);
    }
    

All known issues →