Languages: English • 日本語 Português do Brasil • (Add your language)
Displays the language attributes for the <html>
tag. The possible language attributes are dir
(text direction), lang
and xml:lang
. The choice of lang
and xml:lang
depends on the $doctype
argument.
<?php language_attributes( $doctype ) ?>
<!DOCTYPE html> <html <?php language_attributes(); ?>> <head> ...
(from wp-content/themes/twentyten/header.php
)
May have the following output when the site language on the General Settings is set to English (United States):
<!DOCTYPE html> <html lang="en-US"> ...
Or if the language is set to Spanish the output may be:
<!DOCTYPE html> <html lang="es-ES"> ...
Since: 2.1.0
language_attributes() is located in wp-includes/general-template.php
.