Skip to content

Instantly share code, notes, and snippets.

@lwgists
Created January 5, 2018 18:36
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 lwgists/567919416dc8c1e35580bf829cbe505b to your computer and use it in GitHub Desktop.
Save lwgists/567919416dc8c1e35580bf829cbe505b to your computer and use it in GitHub Desktop.
Control the number of products per page in WooCommerce
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;
}
@lwgists
Copy link
Author

lwgists commented Jan 5, 2018

Add these few lines of code to your theme's functions.php file to allow you to change the number of products per page.

For more details see: https://www.liquidweb.com/kb/control-number-products-per-page-woocommerce/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment