Created
April 22, 2022 07:33
-
-
Save bradleysa/38855303c50d630e69f1a24c062d3d24 to your computer and use it in GitHub Desktop.
WC: Number of Related Products
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function woo_related_products_limit() { | |
global $product; | |
$args['posts_per_page'] = 6; | |
return $args; | |
} | |
add_filter( 'woocommerce_output_related_products_args', 'jk_related_products_args' ); | |
function jk_related_products_args( $args ) { | |
$args['posts_per_page'] = 3; // 3 related products | |
$args['columns'] = 3; // arranged in 3 columns | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment