Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - -
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - -

Supporter timezone: Asia/Jerusalem (GMT+02:00)

Tagged: 

This topic contains 6 replies, has 0 voices.

Last updated by Itamar 2 days, 3 hours ago.

Assisted by: Itamar.

Author Posts
January 19, 2025 at 12:04 pm #16610387

ukuS

Hi

I managed to subscribe but now the issue is that the language switcher (flags on the top right corner of the site) are not leading to the pages as before. Please check this link hidden link and if to then click on the three flags (Finnish, Latvian, Lithuanian) on the top right corner you will see that it doesn’t work. I don’t know what exactly happened as it was working before upgrading to paid version of WPML. I have added the correct links where these flag buttons should lead to in the Customize - Settings - Custom code section.

Could you please help with this?

Thanks

January 19, 2025 at 12:33 pm #16610409

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

I can see this problem on your site.

For the Finnish language, I get this message:

Welcome!
I'm the fox of Veebimajutus.ee and welcome you here. Website is not ready yet, but the owner of the page is working hard to bring it to you as quickly as possible.

Please see the attached screenshot.

If you have a folder named /fi/ in your WordPress installation, this might be the reason for this. You should delete this folder because this might interfere with WPML's Language URL format of Languages Directories.

**** Important! Please make a full site backup (files and DB) before you proceed with those steps****

Other than that, please ensure that the homepage for the Finnish, Latvian, and Lithuanian languages is published.

If it does not help and you need further help with this, please share the access details to your site with me. I'm enabling a private message for the following reply.
Privacy and Security Policy
We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/
**IMPORTANT**
- - Please backup the site files and database before providing us access. --
-- If you have a staging site where the problem can be reproduced, it is better to share access to the staging site.--

Regards,
Itamar.

2025-01-19_14-23-40.jpg
January 20, 2025 at 12:20 pm #16613307

ukuS

Hi Itamar

Let me explain in more detail.
Those flags on the top right corner were working a bit differently for us.
Only the Estonian and English flags lead to our actual website translated sections.
The Finnish, Latvian and Lithuanian flags are supposed to link to an external site of our partners. These are located in other server and are not part of our WordPress.

So we have previously added this code to our Customize - Settings - Custom code section:

});
jQuery("a img[alt=fi]").parent().attr("href", "hidden link");
jQuery("a img[alt=lv]").parent().attr("href", "hidden link");
jQuery("a img[alt=lt]").parent().attr("href", "hidden link");
jQuery(".video-popup-content").on("click", function() {

There you see those links where each flag should direct to.

It doesn't work anymore. Do you know can we solve this is with the flags? If we don't have those translations in these languages but want those flags to direct to our partners external websites, what should we do?

NB. I haven't yet created a back-up of anything. Do you need to log in to our WordPress to check the possible solutions?

Thank you
Uku

January 20, 2025 at 3:13 pm #16614293

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, Uku.

Thanks for adding this important information.

If the Finnish, Latvian, and Lithuanian flags are supposed to link to external sites, then you should remove them from WPML. In other words, they should not be added as secondary languages. This can be done in WPML -> Languages -> Site Languages, and click the Add/Remove Languages button.

Then, you need to create a custom Language Switcher by following the instructions in our guide here.

https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/custom-language-switcher/

The above guide only gives some simple examples. You will need your custom Language Switcher to combine Estonian and English (the languages added by WPML) and the external links you need to the Finnish, Latvian, and Lithuanian websites.

https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/custom-language-switcher/

If you have further questions or doubts about what we explain in the above guide, we will happily answer them. If something is not working in the custom Language Switcher you created, we will be glad to take a look and say what might be the problem.

Otherwise, if you need further help with what you are trying to achieve, I would suggest you consider contacting one of our certified partners from this link:

https://wpml.org/contractors/

Before doing so, please have a look also here:

https://wpml.org/documentation/about-wpml-contractors/what-type-of-work-you-can-expect-from-contractors/

With our contractors, you might get the custom assistance you need to get on with your project.

Regards,
Itamar.

January 21, 2025 at 10:12 am #16617581

ukuS

Hello
Thanks for the info.
But can I create external links to the Finnish, Latvian, and Lithuanian websites by following this guide that you sent? I didn't see there this option to add an external link behind the language flag.

Thanks
Uku

January 22, 2025 at 3:22 pm #16623934

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, Uku.

As I mentioned, you will need custom work to achieve this, which is out of the scope of our support forum. However, I asked our second-tier supporters if they could provide a sample code for your needs. I'll update you here once I have their reply.

I appreciate your patience.
Itamar.

January 22, 2025 at 4:54 pm #16624449

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

Here is a code you can add to the functions.php file of your theme that is supposed to help you with what you are trying to achieve.

function custom_language_switcher_links( $languages ) {
    // Add the first external link
    $languages['external_1'] = array(
        'url' => '<em><u>hidden link</u></em>',
        'native_name' => 'Suomi',
        'translated_name' => 'Finnish',
        'country_flag_url' => 'https://cdn.wpml.org/wp-content/plugins/sitepress-multilingual-cms/res/flags/fi.svg',
        'language_code' => 'fi',
        'code' => 'fi'
    );

    // Add a second external link
    $languages['external_2'] = array(
        'url' => '<em><u>hidden link</u></em>',
        'native_name' => 'Latviešu',
        'translated_name' => 'Latvian',
        'country_flag_url' => 'https://cdn.wpml.org/wp-content/plugins/sitepress-multilingual-cms/res/flags/lv.svg',
        'language_code' => 'lv',
        'code' => 'lv'
    );

    // Add a third external link
    $languages['external_3'] = array(
        'url' => '<em><u>hidden link</u></em>',
        'native_name' => 'Lietuvių',
        'translated_name' => 'Lithuanian',
        'country_flag_url' => 'https://cdn.wpml.org/wp-content/plugins/sitepress-multilingual-cms/res/flags/lt.svg',
        'language_code' => 'lt',
        'code' => 'lt'
    );

    return $languages;
}
add_filter( 'icl_ls_languages', 'custom_language_switcher_links' );


**** Important! Please make a full site backup (files and DB) before you proceed with those steps****

Best Regards,
Itamar.