Skip to content

Instantly share code, notes, and snippets.

@softiconic
Last active December 2, 2023 18:47
Show Gist options
  • Save softiconic/df6a591bfd2c8fe7ffc0d5908e10cf46 to your computer and use it in GitHub Desktop.
Save softiconic/df6a591bfd2c8fe7ffc0d5908e10cf46 to your computer and use it in GitHub Desktop.
The quantity of products shown per page on the WooCommerce shop page.
/**
* Change number of products that are displayed per page (shop 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