twentythirteen_body_class

Extend the default WordPress body classes.

Description

(array) twentythirteen_body_class( (array) $classes ); 

Adds body classes to denote: 1. Single or multiple authors. 2. Active widgets in the sidebar to change the layout and spacing. 3. When avatars are disabled in discussion settings.

Returns (array)

The filtered body class list.

Parameters (1)

0. $classes (array)
A list of existing body class values.

Usage

  1. if ( !function_exists( 'twentythirteen_body_class' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4. // A list of existing body class values. 
  5. $classes = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = twentythirteen_body_class($classes); 
  9.  

Defined (1)

The function is defined in the following location(s).

/functions.php  
  1. function twentythirteen_body_class( $classes ) { 
  2. if ( ! is_multi_author() ) 
  3. $classes[] = 'single-author'; 
  4.  
  5. if ( is_active_sidebar( 'sidebar-2' ) && ! is_attachment() && ! is_404() ) 
  6. $classes[] = 'sidebar'; 
  7.  
  8. if ( ! get_option( 'show_avatars' ) ) 
  9. $classes[] = 'no-avatars'; 
  10.  
  11. return $classes;