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.

Related documentation: WPML Coding API

This topic contains 3 replies, has 2 voices, and was last updated by  Harshad 6 years, 4 months ago. The support staff assigned to this topic is Harshad.

Author Posts
Author Posts
March 22, 2012 at 2:57 pm #52945

Viviana

Is there a global variable that I can call as an IF statement within my header.php template to load up a different HTML (menu graphics), depending on the language chosen?

If X=english, use this batch of html, else use this other batch of html.

Thanks! Great plug in!

March 22, 2012 at 5:23 pm #52968

Harshad

You can use the ICL_LANGUAGE_CODE constant together with php if statements.

<?php if(ICL_LANGUAGE_CODE=='en'): ?>
….english content here ….
<?php elseif(ICL_LANGUAGE_CODE=='fr'): ?>
…french content here…
<?php endif;?>
March 22, 2012 at 5:44 pm #52973

Viviana

Worked perfectly. Thanks for the prompt response!

March 23, 2012 at 4:47 am #53010

Harshad

Hello Viviana,

We are glad to know your issue(s) have been fixed.

If you have any more questions please feel free to get back to us.

Have a nice day!

Thanks,

Harshad

The topic ‘[Closed] Translation of hard coded HTML text’ is closed to new replies.