Skip to content

Instantly share code, notes, and snippets.

@anhnn-mageplaza
Last active July 14, 2021 04:01
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 anhnn-mageplaza/9eb2df64fe2b2806118500053f1b4a01 to your computer and use it in GitHub Desktop.
Save anhnn-mageplaza/9eb2df64fe2b2806118500053f1b4a01 to your computer and use it in GitHub Desktop.
Code to change product number per page in WooCommerce
/**
* 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 = 10
return $cols;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment