Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.25 KB | None | 0 0
  1. /**
  2.  * Filter content column classes
  3.  *
  4.  * @since goodz magazine 1.0
  5.  */
  6. function goodz_content_cols() {
  7.  
  8.     if ( goodz_is_woocommerce_activated() ) {
  9.         if ( is_cart() || is_checkout() || goodz_is_page( 'woocommerce-account' ) || goodz_is_page( 'woocommerce-wishlist' ) ) {
  10.             return;
  11.         }
  12.     }
  13.  
  14.     // Primary container classes
  15.     $cols = 'col-lg-12';
  16.  
  17.     // Get global layout setting
  18.     $global_layout = get_theme_mod( 'archive_layout_setting', 'boxed' );
  19.  
  20.     if ( is_active_sidebar( 'sidebar-1' ) || is_active_sidebar( 'sidebar-2' ) ) {
  21.  
  22.         if ( 'fullwidth' == $global_layout && ( is_archive() || is_home() ) ) {
  23.             $cols = 'col-lg-10 col-md-9 has-sidebar';
  24.         }
  25.         else {
  26.             $cols = 'col-md-9 has-sidebar';
  27.         }
  28.     }
  29.    
  30.     if ( is_active_sidebar( 'sidebar-1' ) && is_active_sidebar( 'sidebar-2' ) ) {
  31.  
  32.         if ( 'fullwidth' == $global_layout && ( is_archive() || is_home() ) ) {
  33.             $cols = 'col-lg-10 col-md-6 has-sidebar';
  34.         }
  35.         else {
  36.             $cols = 'col-md-6 has-sidebar';
  37.         }
  38.     }
  39.    
  40.     else {
  41.         $cols = 'col-sm-12';
  42.     }
  43.  
  44.     if ( is_single() ) {
  45.         // Container classes relevant to sidebar
  46.         $cols = 'no-sidebar';
  47.  
  48.         if ( is_active_sidebar( 'sidebar-1' ) ) {
  49.             $cols = 'has-sidebar';
  50.         }
  51.     }
  52.  
  53.     echo esc_attr( $cols );
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement