Skip to content

Instantly share code, notes, and snippets.

@growdev
Created April 9, 2013 19:53
Show Gist options
  • Save growdev/5348814 to your computer and use it in GitHub Desktop.
Save growdev/5348814 to your computer and use it in GitHub Desktop.
WooCommerce - Change Number of Related Products displayed on the Product page
<?php
// Add this to your theme's functions.php file
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
function custom_output_related_products() {
// Display 5 products in 5 columns
woocommerce_related_products( 5, 5 );
}
add_action( 'woocommerce_after_single_product_summary', 'custom_output_related_products', 20 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment