WordPress.org

Codex

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

Function Reference/get body class

Retrieves the classes for the body element as an array.

Usage

<?php get_body_class($class); ?>

Parameters

$class
(string or array) (optional) A string or array of classes to add to the return value
Default: false

Return Value

(array) 
An array of class names.

Change Log

  • Since: 2.8.0
  • 3.1.0 Added support for ID style classes

Source File

get_body_class() is located in wp-includes/post-template.php.

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