Due to the large volume of support requests, at the moment there is a waiting time of more than 24 hours. We apologize for the inconvenience this causes. We do not have any recurring unknown issues so we encourage you to please search the forum for other support topics that might be helpful and to review our documentation and look at our errata page for known issues. A supporter will respond to you as soon as possible.

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

Last updated by Harshad 6 years, 6 months ago.

Assigned support staff: Harshad.

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


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


April 2, 2012 at 4:51 pm #54363


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



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.