0

I'm using a child theme to the default WooCommerce Storefront theme. I would like to change the maximum number of products shown on the shop pages, to be unlimited (no pagination).

How would you go about this?

2

You can add this code to your functions.php:

/**
 * 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( $products ) {
  // Return the number of products you wanna show per page.
  $products = 100;
  return $products;
}

Change the 100 for more if you need it, since you don't want pagination simply put a high number and you won't have pagination.

Change the number of products displayed per page

  • Thanks! If you can just change the $colsvariable to $products or something more descriptive, just to avoid confusion for future reference, I'll mark your answer as accepted. – Pim Sep 13 '18 at 14:51
  • 2
    You are right, done ;) – Castiblanco Sep 13 '18 at 15:01
  • 2
    Actually just a small correction: the number of products per page isn't based on the value under Settings -> Reading. – Pim Sep 13 '18 at 16:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.