We Make Amazing Free Storefront Child Themes for WordPress & WooCommerce

View Our Newest Theme
Posted on

How to change the number of products per page in Storefront

Normally when adjusting the number of products per page in WooCommerce you would need to navigate to Settings > Reading in the WordPress admin area. There is an input field titled Blog pages show at most and then the number 10.

Well, you would normally change this value to whatever you would want, changing it also has the side effect of changing the number of blog posts per page as well.

Storefront does not allow you to change this value for the number of products per page.

So that is where we need to write, or copy in this case, some WordPress PHP code.

Here it is below:

/**
 * Change number of products per page
 */

add_filter( 'storefront_products_per_page', 'sf_child_products_per_page' );
function sf_child_products_per_page() {
	return 18;
}

See the number 18? That’s the number you can change to whatever your heart desires.

Remember this goes into your Storefront child theme’s functions file.

Happy coding!

We Make Amazing Free Storefront Child Themes for WordPress & WooCommerce

View Our Newest Theme

2 thoughts on “How to change the number of products per page in Storefront

  1. Will this code work in a non storefront theme? THanks.

    1. Nope, sorry Stacy, this will only work in a Storefront or Storefront child theme.

Leave a Reply

Your email address will not be published. Required fields are marked *