Created
May 9, 2016 18:25
-
-
Save rynaldos-zz/ddb1cded01e54d2ed8a0a5cae9bcbc23 to your computer and use it in GitHub Desktop.
Change 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'] = 6; // 4 related products | |
$args['columns'] = 3; // arranged in 2 columns | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment