Skip to content

Instantly share code, notes, and snippets.

@jameskoster
Forked from mikejolley/functions.php
Last active February 5, 2017 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jameskoster/5563860 to your computer and use it in GitHub Desktop.
Save jameskoster/5563860 to your computer and use it in GitHub Desktop.
WooCommerce - change number of upsells displayed and number of columns
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );
add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_upsells', 15 );
if ( ! function_exists( 'woocommerce_output_upsells' ) ) {
function woocommerce_output_upsells() {
woocommerce_upsell_display( 3,3 ); // Display 3 products in rows of 3
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment