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.

This topic contains 1 reply, has 2 voices.

Last updated by Bruno 3 months ago.

Assigned support staff: Bruno.

Author Posts
July 19, 2019 at 9:37 pm #4248359

brianG-6

Hello,

I have some links hardcoded in my theme. The post types they link to are set to 'translatable - show default language if no translation exists.' When I switch to a different language, the links stay in English. How can I set them so that clicking the links keeps the user in their chosen language? I found this article: https://wpml.org/documentation/support/creating-multilingual-wordpress-themes/hard-coded-theme-links, but it says it will show the original language link if a translated version doesn't exist. What I really want is for it to stay in the current language, and show the english version of the post if the translated version doesn't exist.

July 19, 2019 at 11:35 pm #4248497

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

Thank you for contacting us. I would be very happy to help you but I didn't fully understand what is the issue.

>>> What I really want is for it to stay in the current language, and show the english version of the post if the translated version doesn't exist.

Are you talking about pages/posts or hard-coded links? The "Translatable - use translation if available or fallback to default language" feature is intended for pages/posts and not for hard-coded links.

For hard-coded links, you will need to follow the steps of our documentation at the link you posted above. In this case, the best option would be to translate all pages that are using these hard-coded links and then change the links as shown in the documentation.

If this is not what you are asking, can you please elaborate a little more so I can better understand? Sometimes screenshots illustrating what you mean may go a long way to clarify what words fail to transmit so if you like make use of "upload an image" below the comment area.

Thank you.

The topic ‘[Closed] Showing links in current language’ is closed to new replies.