layers_body_class

The Layers layers body class function.

Description

layers_body_class( $classes ); 

Parameters (1)

0. $classes
The classes.

Usage

  1. if ( !function_exists( 'layers_body_class' ) ) { 
  2. require_once '/core/helpers/template.php'; 
  3.  
  4. // The classes. 
  5. $classes = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = layers_body_class($classes); 
  9.  

Defined (1)

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

/core/helpers/template.php  
  1. function layers_body_class( $classes ) { 
  2.  
  3. $header_menu_layout = layers_get_theme_mod( 'header-menu-layout'); 
  4. $header_sticky_option = layers_get_theme_mod( 'header-sticky' ); 
  5. $header_overlay_option = layers_get_theme_mod( 'header-overlay'); 
  6.  
  7. // Handle menu layout 
  8. $classes[] = 'body-' . $header_menu_layout; 
  9.  
  10. // Handle sticky / not sticky 
  11. if( TRUE == $header_sticky_option && 'header-sidebar' != $header_menu_layout ) { 
  12. $classes[] = 'layers-header-sticky'; 
  13.  
  14. // Handle overlay / not overlay 
  15. if( TRUE == $header_overlay_option && 'header-sidebar' != $header_menu_layout ) { 
  16. $classes[] = 'layers-header-overlay'; 
  17.  
  18. // Add class that spans across all post archives and single pages 
  19. if( layers_is_post_list_template() || is_archive() || is_singular( 'post' ) ) { 
  20. $classes[] = 'layers-post-page'; 
  21.  
  22. return apply_filters( 'layers_body_class', $classes );