Skip Navigation

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 9 years, 8 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.