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 3 replies, has 2 voices.

Last updated by Bobby 1 year ago.

Assigned support staff: Bobby.

Author Posts
June 10, 2019 at 7:34 pm


I am trying to:
I have a page in 3 languages, first I created the Macedonian one, than I installed WPML and added English and Albanian. For some of the pages I have created a php file with id, like page_xx.php. I have translated the content of the page in WPML but when I check it in English or Albanian it's translated but it's not taking that template defined by page_xx.php. I have enabled the 'Make themes work multilingual' checkbox in the first place.

Link to a page where the issue can be seen:
For example take page_33.php, the original link in Macedonian is : hidden link (cyrilic encoding), in English : hidden link and Albanian : hidden link
You can notice that original page in Macedonian has a sidebar which is defined in page_33.php but it's not used on English and Albanian. Let me know what I am doing wrong because I used WPML before and this was not happening.

I expected to see:
Explained above 🙂

Instead, I got:

June 10, 2019 at 8:28 pm #3990263


Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)


If i understand correctly you have defined a page template and then you parse the page id for the template to take place?

note that each translation has a different page id , you can find the page ids by clicking on the default language page and then using the language switcher to switch to the secondary language

this will ensure you remain within the page builder view, on the top in the URL you will be able to see the page ID

additionally this way you can verify the settings in each language to make sure they are set correctly

let me know your results please

June 10, 2019 at 9:25 pm #3990473


Hello Bobby, thank for the quick reply. Is there some way I can make one page template that will be used by all 3 languages, because inside I use string translations and if I want to make some small change to the template I will have to make it in 3 page templates (If I use ID)?

June 10, 2019 at 11:24 pm #3990721


Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

As a test i used your FTP credentials , went to your page templates and duplicated page-33.php then renamed the new one to page-1409 ( i have added .deactivated next to it within the FTP so it wont show on your live site, but it is there if you want to test it)which is the id for the Albanian version of that page and as expected the sidebar came up.

There are 2 things that will need to be addressed here

1. If you are planning on translating these strings say from Macedonian to Albanian for example without trying to make the translations hardcoded(thats if you use only one page template) then you will need to wrap your strings in a gettext call so String Translations can pick them up and allow you to make translations


2. To only use one template for all page you will need to make sure that it grabs the id of the post rather than parsing the Id through the name of the file "ex. page-33.php"

this will require change in your code

i personally believe this is an expected behavior as a different template is expected per page as discussed here [please review the solution another user has used]

i recommend reviewing our WPML hooks library

Please note that at the moment we cannot provide custom work within the forum , but we do recommend using our 3rd party WPML contractors if custom work is needed

The topic ‘[Closed] Translating the pages with ID’ is closed to new replies.