In case we need to add a language class to address some CSS styling to different languages individually, e.g. when using WPML or Polylang, we can add this little piece of code to our functions.php:
1 2 3 4 5 6 |
/* Adding a language class to the body to apply styles individually per language */ add_filter('body_class', 'append_language_class'); function append_language_class($classes){ $classes[] = 'language-'.ICL_LANGUAGE_CODE; return $classes; } |
Hi!!
Eternal appreciation for this!
You are the best! thank you :D