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.

Tagged: ,

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

Author Posts
Author Posts
April 2, 2012 at 4:44 pm #54361

info@upavim-mayanhands.org

Hi - To customize the CSS for different language fonts I need to target the page's content for the different languages.

How can I add a class to the body tag when viewing different languages? I'm willing to add some php to the template files if it's not built into the admin already.

...dutch, spanish, english, ...whatever

/Marco

April 2, 2012 at 4:51 pm #54363

Dominykas

For example, <body class="body-lang-<?php echo ICL_LANGUAGE_CODE; ?>">

then you should have something like this for Spanish language:
.body-lang-es #content { }

for English language:
.body-lang-en #content { }

April 3, 2012 at 6:03 am #54398

Harshad

@Marco,

What Dominykas provided you the code, you can try it.

The topic ‘[Closed] How to add class to body tag = Language’ is closed to new replies.