WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/language attributes

Contents

Description

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.

Usage

<?php language_attributes$doctype ?>

Parameters

$doctype
(string) (optional) The type of html document 'xhtml' or 'html'.
Default: 'html'

Return Values

(void) 
This function does not return a value.

Examples

<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
...

(from wp-content/themes/twentyten/header.php)


Notes

  • Uses: get_bloginfo() May call to get 'text_direction' or 'language'.
  • Uses: apply_filters() Calls 'language_attributes' on output just before sending it to browser.

Changelog

Since: 2.1.0

Source File

language_attributes() is located in wp-includes/general-template.php.

Related

See also index of Function Reference and index of Template Tags.