Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Filter content column classes
- *
- * @since goodz magazine 1.0
- */
- function goodz_content_cols() {
- if ( goodz_is_woocommerce_activated() ) {
- if ( is_cart() || is_checkout() || goodz_is_page( 'woocommerce-account' ) || goodz_is_page( 'woocommerce-wishlist' ) ) {
- return;
- }
- }
- // Primary container classes
- $cols = 'col-lg-12';
- // Get global layout setting
- $global_layout = get_theme_mod( 'archive_layout_setting', 'boxed' );
- if ( is_active_sidebar( 'sidebar-1' ) || is_active_sidebar( 'sidebar-2' ) ) {
- if ( 'fullwidth' == $global_layout && ( is_archive() || is_home() ) ) {
- $cols = 'col-lg-10 col-md-9 has-sidebar';
- }
- else {
- $cols = 'col-md-9 has-sidebar';
- }
- }
- if ( is_active_sidebar( 'sidebar-1' ) && is_active_sidebar( 'sidebar-2' ) ) {
- if ( 'fullwidth' == $global_layout && ( is_archive() || is_home() ) ) {
- $cols = 'col-lg-10 col-md-6 has-sidebar';
- }
- else {
- $cols = 'col-md-6 has-sidebar';
- }
- }
- else {
- $cols = 'col-sm-12';
- }
- if ( is_single() ) {
- // Container classes relevant to sidebar
- $cols = 'no-sidebar';
- if ( is_active_sidebar( 'sidebar-1' ) ) {
- $cols = 'has-sidebar';
- }
- }
- echo esc_attr( $cols );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement