Reading // Return the number of products you wanna show per page. $cols = 12; return $cols; } // Change number or related products on product page function woo_related_products_limit() { global $product; $args['posts_per_page'] = 3; return $args; } add_filter( 'woocommerce_output_related_products_args', 'new_shop_related_products_args' ); function new_shop_related_products_args( $args ) { $args['posts_per_page'] = 3; // 4 related products $args['columns'] = 3; // arranged in 2 columns return $args; } //Before content if ( ! function_exists( 'new_shop_before_content' ) ) { /** * Before Content * Wraps all WooCommerce content in wrappers which match the theme markup * * @since 1.0.0 * @return void */ function new_shop_before_content() { ?>
cart->cart_contents_count; ?> cart->cart_contents_count; ?>
'; return $form; } add_action( 'woocommerce_before_main_content', 'new_shop_before_content', 10 ); add_action( 'woocommerce_after_main_content', 'new_shop_after_content', 10 ); add_action( 'new_shop_shop_sidebar', 'new_shop_shop_sidebar', 10 ); add_action( 'new_shop_theme_header_top', 'new_shop_wc_cart_count' ); add_action( 'new_shop_product_search', 'new_shop_product_search' ); add_filter( 'woocommerce_add_to_cart_fragments', 'new_shop_header_add_to_cart_fragment' );