Maybe you could use a filter to add the current language of the website to the body class.
add_filter('body_class', 'language_in_body_classes');
function language_in_body_classes($classes) {
$classes[] = get_bloginfo('language');
return $classes;
}
Edit : maybe I misunderstood what you wanted. There is actually a language_attributes filter but I do not think it would be very standard to add classes to the html language attr.
Related Posts:
- body_class filter – Is there a better way to write this code?
- WordPress php filter admin_body_class not working
- Handling Body class based on Template
- How to make a image-size selected by default in Media upload – WP v3.5
- Apply class to every paragraph that holds image?
- Remove “Insert from URL” link in Media upload – WP 3.5
- static variable loop not working in WordPress
- How to change the wp-login.php page title?
- adding a filter to a shortcode?
- Hide custom image sizes from media library
- Set media upload attachment link to none and hide it in WP v3.5
- How to set custom cookies before output
- Add post class to the TinyMCE iframe?
- Permanently remove first image from posts
- Change the footer text on the login page
- How can I hook into and edit the text of a wp_nav_menu tag?
- Rename image uploads replacing “width” and “height” in filename with “medium”, “large”, “small”
- add_filter to post-gallery and remove all ‘s?
- Rename image uploads with width in filename
- How to make an meta_query optional?
- How to overwrite youtube embed?
- Rewriting search and pagination base
- Check if page parent has certain template
- How to remove “out of stock” variation options from size dropdown in woocommerce?
- Change comments form title on a page by page basis
- Filter the blog title displayed in the header
- Display only text to WordPress loop without loosing the text formatting
- Remove class that has been added by parent theme
- append PHP function to the_content
- “Maximum function nesting level of ‘100’ reached” after adding a new filter
- How do I know what variables are passed in a filter/action and what their meaning is?
- Find variables available at a given hook
- wp_get_attachment_url filter won’t accept two arguments
- Why do filters/actions require an argument count?
- How to add Shortcode (font awesome) in widget title?
- Filter link to existing content suggestion
- Getting my head round WordPress filter
- How To Change The Html of Products filtration sidebar in Woocommerce?
- Woocommerce filter cart and category specific quantity [closed]
- How to set a custom path, for ajax image upload folder in admin?
- Filter get_the_title to remove certain characters?
- Wrap First Character after in a tag
- Get posts with at least one category in common with current post?
- WooCommerce: Add Payment Gateway Field to Webhooks [closed]
- How to use return in my custom function instead of echo
- When using the_author hook, how can I determine the PHP file that generates each call to `the_author()`?
- How to call function at the bottom of post using plugin?
- Problem adding class to body_class
- Run a filter when a walker runs
- Combine two filters into a single call
- Remove a filter added by a plugin
- Change the site tagline (or similar) based on current page
- Get_avatar filter?
- WooCommerce Related Products by Attribute
- Custom filter in admin edit custom post type responding with invalid post type?
- Add a class to the anchor tag on HTML5 gallery
- Nesting if statements to echo only one string based on what tag was filtered?
- How to properly loop through these external URLs to get them into the sitemap using this hook
- Input type search in Menu
- add_action shortcut?
- Is it acceptable to treat a filter like an action?
- How can I remove a function that has been added to wordpress with add_filter?
- How to control WordPress image metadata (using Imagick)?
- How to add seperate classes to no-search-result and found-search-result pages on wordrpess search – is_search()
- Edit incorrect password message WordPress
- How do I add custom bulk actions to multiple custom post types?
- Add data attribute to each li in menu
- Show prices with tax in Woocommerce Mini Cart [closed]
- Ajax category filtering products default show all
- Add a specific part of current category page url to shortcode
- Why does my callback function not work with this custom filter hook?
- Contact Fom 7 – how to add custom HTML inside span.wpcf7-form-control-wrap AND IMMEDIATELY AFTER input.wpcf7-form-control?
- Removing “wpautop” (auto tags) only on certain pages?
- Add filter when image is uploaded?
- Remove the first 5 characters of the_title and orderby that
- Remove a div from RSS feed
- Print last modified date only on posts
- How to add an arrow to menu items has submenus
- WordPress Gravatar filter is removing my custom attributes
- Generating an nonce for Content Security Policy and all scripts – How to make it match/persist for each page load?
- Unique icons next to each WordPress menu item
- Change tinyMCE editor to allow marked content when pasting from Word
- Problem with login form
- Alter required message using comment form api
- How to debug this search & replace strings snippet?
- Hide Featured Image Meta Box on Editor Screen
- Add item to top of menu using a filter in functions.php
- Add filter multiple times using only one master function
- How to edit php code in WordPress Post file?
- Change page title from page using php via php executed from page/post itself
- How to make modifications only to certain elements of an HTML string on the server-side?
- Override a function defined in wp-includes/comment-template.php
- Need to put a script above tag in header.php – WP 5.7.1
- Filtering a function’ output for a new continued function
- Deleting Certain terms from appearing on the front end as links
- Content filter won’t work
- Warning: in_array() null given in PHP function
- Upload multiple files in randomly generated folder using wp_upload_bits
- Create page template via functions.php?
- Add meta tags to a custom header