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 Anonymous 7 years, 1 month ago.

Author Posts
June 27, 2012 at 2:32 pm #65093


I have a site with 2 subdomain :
- hidden link -> english version
- -> french version

But, the get_template_directory_uri() function give always "" in both case. Is this a method in WPML to have "" in the translated version ?


June 28, 2012 at 1:50 am #65167


Dear Jean,
Since all files of the website i.e css, javascript and all are stored in the original language directory path i.e "…" , its only logical that even the secondary language site is using the same directory path for its files.
But if you want otherwise,
then you can set absolute paths together with "php if" conditional statements like this

<?php if(ICL_LANGUAGE_CODE=='language-code-1'): ?>

...absolute path to your files here.....

<?php elseif(ICL_LANGUAGE_CODE=='language-code-2'): ?>

....another absolute path to your files here...

<?php endif;?>

You can find your language codes in WPML->Languages->Edit Languages
then replace language-code-2 and language-code-1 with the respective codes.

The topic ‘[Closed] get_template_directory_uri() per language (subdomain))’ is closed to new replies.