Skip to content

Instantly share code, notes, and snippets.

@DanielSantoro
Created October 12, 2017 19:01
Show Gist options
  • Save DanielSantoro/d43cf267008676b6a9bc6a137c55b8d8 to your computer and use it in GitHub Desktop.
Save DanielSantoro/d43cf267008676b6a9bc6a137c55b8d8 to your computer and use it in GitHub Desktop.
Lindsey Foard PHP
<?php
/**
* Change the number of Related Products per Page to 5
*/
add_filter( 'woocommerce_output_related_products_args', 'lf_related_products_args', 20 );
function lf_related_products_args( $args ) {
$args['posts_per_page'] = 5; // 5 related products
$args['columns'] = 5; // arranged in 5 columns
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment