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 Bigul 3 months, 4 weeks ago.

Assigned support staff: Bigul.

Author Posts
June 17, 2019 at 12:33 pm #4035313

allanK-2

I changed my site Language URL format , now it's a Different languages in directories, but I need to show site-domain/wp-content/themes/my-theme/example.php file, in the past I set ?lang=ICL_LANGUAGE_CODE and it worked, but now I don't know where to put language code to get translated page

June 17, 2019 at 6:24 pm #4037767

Bigul
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello,

Welcome to the WPML support forum. I will do my best to help you to resolve these issues.

ICL_LANGUAGE_CODE is constant so it will be returning the current language code as expected. The result will be the same if the language URL format is *Different languages in directories* or *Language name added as a parameter* or *A different domain per language*.

Please make sure it by resaving the permalinks(from Settings>>Permalinks) and let me know your feedback.

Please check the following documentation for more details.

https://wpml.org/documentation/support/wpml-coding-api/#language-constants

https://wpml.org/documentation/support/translating-the-theme-you-created/

--
Thanks!

Bigul

The topic ‘[Closed] Translate .php file in my theme’ is closed to new replies.