Related question: change-the-number-of-products… Using code from Woo Docs

I can specify the number of items per page, but sometimes fewer items appear. I suspect that this code selects the desired number of items from the database without considering quantity available, then some part of the system removes any items that have quantity less than 1, and displays what’s left.

// Display 24 products per page. Goes in functions.php
add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 24;' ), 20 );
  1. Am I correct?
  2. How do I make it REALLY display the desired number of items per page?

Yes, I understand that the last page might have fewer items. That should go without saying, but I figured it best to be specific. I’m talking about pages besides the last page.

Read more here: WordPress – Woo Commerce Ensure that products per page is consistent


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: