Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
314 B
2
Indexable
Never
function my_custom_body_class($classes) {
    $lang = apply_filters('wpml_current_language', NULL);
    if ($lang) {
        $classes[] = 'lang-' . $lang;  // This will add a class like "lang-en" for English, "lang-fr" for French, etc.
    }
    return $classes;
}
add_filter('body_class', 'my_custom_body_class');
Leave a Comment