Skip to content

Instantly share code, notes, and snippets.

@lmartins
Created January 7, 2015 20:31
Show Gist options
  • Save lmartins/3cf782c914036a24c306 to your computer and use it in GitHub Desktop.
Save lmartins/3cf782c914036a24c306 to your computer and use it in GitHub Desktop.
Change the default number of related products
/**
* ----------------------------------------------------------------------------
* CHANGE THE NUMBER OF RELATED PRODUCTS
* ----------------------------------------------------------------------------
*/
add_filter( 'woocommerce_output_related_products_args', 'mw_related_products_args' );
function mw_related_products_args( $args ) {
$args['posts_per_page'] = 4; // 4 related products
$args['columns'] = 2; // arranged in 2 columns
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment