cart->get_cart_contents_count(), 'beshop' ), WC()->cart->get_cart_contents_count() ); ?>
esc_html__( 'Shop Sidebar', 'beshop' ), 'id' => 'shop-sidebar', 'description' => esc_html__( 'Add shop widgets here.', 'beshop' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'beshop_woowidgets_init' ); } if ( ! function_exists( 'beshop_body_wooclasses' ) ) { function beshop_body_wooclasses( $classes ) { if ( ! is_active_sidebar( 'shop-sidebar' ) && is_shop() ) { $classes[] = 'no-shop-widget'; } if ( is_front_page() && is_shop() ) { $classes[] = 'befront-shop'; } return $classes; } add_filter( 'body_class', 'beshop_body_wooclasses' ); } /** * Change number or products per row */ add_filter('loop_shop_columns', 'beshop_loop_columns', 999); if (!function_exists('beshop_loop_columns')) { function beshop_loop_columns() { if(is_active_sidebar( 'shop-sidebar' )){ return 3; // 3 products per row } return 4; // 4 products per row } }