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

', 'after_title' => '

', )); } add_action('widgets_init', 'asthir_woowidgets_init'); } if (!function_exists('asthir_body_wooclasses')) { function asthir_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', 'asthir_body_wooclasses'); } /** * Change number or products per row */ add_filter('loop_shop_columns', 'asthir_loop_columns', 999); if (!function_exists('asthir_loop_columns')) { function asthir_loop_columns() { if (is_active_sidebar('shop-sidebar')) { return 3; // 3 products per row } return 4; // 4 products per row } } function asthir_products_pagination($max_num_pages) { $big = 999999999; // need an unlikely integer $pages = paginate_links(array( 'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), 'format' => '?paged=%#%', 'current' => max(1, get_query_var('paged')), 'total' => $max_num_pages, 'type' => 'array', 'prev_text' => __('« Previous', 'asthir'), 'next_text' => __('Next »', 'asthir'), )); if (is_array($pages)) { $pagination = ''; echo $pagination; } }