' . esc_html( get_the_title() ) . ''; echo ''; } } // Remove sidebar in woocommerce page and add conditional sidebar remove_action('woocommerce_sidebar', 'woocommerce_get_sidebar', 10); add_action( 'woocommerce_sidebar', 'agency_plus_woocommerce_sidebar', 10 ); function agency_plus_woocommerce_sidebar( ) { $shop_layout = agency_plus_get_option( 'shop_layout' ); // Include sidebar. if ( 'no-sidebar' !== $shop_layout ) { get_sidebar(); } }; // Return the number of products you want to show per page add_filter( 'loop_shop_per_page', 'agency_plus_new_loop_shop_per_page', 20 ); function agency_plus_new_loop_shop_per_page( $cols ) { $product_per_page = agency_plus_get_option( 'product_per_page' ); $cols = absint( $product_per_page ); return $cols; } // Remove sorting option $hide_product_sorting = agency_plus_get_option( 'hide_product_sorting' ); if( true === $hide_product_sorting ){ remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 ); } // Disable Related Products $disable_related_products = agency_plus_get_option( 'disable_related_products' ); if( true === $disable_related_products ){ remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 ); } // Update number of items in cart and total after Ajax add_filter( 'woocommerce_add_to_cart_fragments', 'agency_plus_header_add_to_cart_fragment' ); function agency_plus_header_add_to_cart_fragment( $fragments ) { global $woocommerce; ob_start(); ?> cart->get_cart_contents_count() );?>