Skip to content

Instantly share code, notes, and snippets.

@ajmorris
Created December 6, 2017 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajmorris/2e0b1d1095c14518420742fbfa0eba43 to your computer and use it in GitHub Desktop.
Save ajmorris/2e0b1d1095c14518420742fbfa0eba43 to your computer and use it in GitHub Desktop.
Add these few lines of code to your theme's functions.php file to allow you to change the number of products per page
add_filter( 'loop_shop_per_page', 'new_loop_shop_per_page', 20 );
function new_loop_shop_per_page( $cols ) {
// $cols contains the current number of products per page based on the value stored on Options -> Reading
// Return the number of products you wanna show per page.
$cols = 9;
return $cols;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment