Created
August 5, 2016 16:23
-
-
Save mrfoxtalbot/18ce2e0bb2d920c4d0e1bb882a46f094 to your computer and use it in GitHub Desktop.
Add language based CSS class to body tag in WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function append_language_class($classes){ | |
$classes[] = ICL_LANGUAGE_CODE; //or however you want to name your class based on the language code | |
return $classes; | |
} | |
add_filter('body_class', 'append_language_class'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment