layers_set_content_width

Adjust the content width when the full width page template is being used.

Description

layers_set_content_width(); 

Usage

  1. if ( !function_exists( 'layers_set_content_width' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = layers_set_content_width(); 
  7.  

Defined (1)

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

/functions.php  
  1. function layers_set_content_width() { 
  2. global $content_width; 
  3.  
  4. $left_sidebar_active = layers_can_show_sidebar( 'left-sidebar' ); 
  5. $right_sidebar_active = layers_can_show_sidebar( 'right-sidebar' ); 
  6.  
  7. if( is_page_template( LAYERS_BUILDER_TEMPLATE ) ) { 
  8. $content_width = 1080; 
  9. } else if( is_page_template( 'template-both-sidebar.php' ) || 
  10. is_page_template( 'template-left-sidebar.php' ) || 
  11. is_page_template( 'template-right-sidebar.php' ) ) { 
  12. $content_width = 660; 
  13. } elseif ( is_page_template( 'template-blog.php' ) ) { 
  14. $content_width = 1080; 
  15. } elseif( $left_sidebar_active || $right_sidebar_active ) { 
  16. $content_width = 660;