twentyeleven_layout_classes

Add Twenty Eleven layout classes to the array of body classes.

Description

twentyeleven_layout_classes( $existing_classes ); 

Parameters (1)

0. $existing_classes
The existing classes.

Usage

  1. if ( !function_exists( 'twentyeleven_layout_classes' ) ) { 
  2. require_once '/inc/theme-options.php'; 
  3.  
  4. // The existing classes. 
  5. $existing_classes = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = twentyeleven_layout_classes($existing_classes); 
  9.  

Defined (1)

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

/inc/theme-options.php  
  1. function twentyeleven_layout_classes( $existing_classes ) { 
  2. $current_layout = $options['theme_layout']; 
  3.  
  4. if ( in_array( $current_layout, array( 'content-sidebar', 'sidebar-content' ) ) ) 
  5. $classes = array( 'two-column' ); 
  6. else 
  7. $classes = array( 'one-column' ); 
  8.  
  9. if ( 'content-sidebar' == $current_layout ) 
  10. $classes[] = 'right-sidebar'; 
  11. elseif ( 'sidebar-content' == $current_layout ) 
  12. $classes[] = 'left-sidebar'; 
  13. else 
  14. $classes[] = $current_layout; 
  15.  
  16. $classes = apply_filters( 'twentyeleven_layout_classes', $classes, $current_layout ); 
  17.  
  18. return array_merge( $existing_classes, $classes );