WordPress at a glance

body_class() WP 1.0

Display the classes for the body element.

Works based on: get_body_class()
✈ 1 time = 0.000176s = fast | 50000 times = 3.11s = fast PHP 7.0.14, WP 4.7

No Hooks.

Return

Nothing (null).

Usage

body_class( $class );
$class(string/array)
One or more classes to add to the class list.
Default: ''

Code of body_class: wp-includes/post-template.php VER 4.9.8

<?php
function body_class( $class = '' ) {
	// Separates classes with a single space, collates classes for body element
	echo 'class="' . join( ' ', get_body_class( $class ) ) . '"';
}

Related Functions

From tag: Decor (design, layout, styling, class)

More from category: Other Theme Functions

More from Template Tags: Posts, Pages, ...

No comments
    Hello, !     Log In . Register