Created
May 24, 2019 03:50
-
-
Save carlosrudriguez/81ef7f1a275949371c39bf283a5f734e to your computer and use it in GitHub Desktop.
Change number of product upsells in WooCommerce
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
/** | |
* Change number of upsells output | |
*/ | |
add_filter( 'woocommerce_upsell_display_args', 'wc_change_number_related_products', 20 ); | |
function wc_change_number_related_products( $args ) { | |
$args['posts_per_page'] = 1; //change number of upsells here | |
$args['columns'] = 4; //change number of columns here | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment