How to Set the Number of Products Per Page in WooCommerce

>How to Set the Number of Products Per Page in WooCommerce
  • shopping cart products

If your WordPress theme supports WooCommerce, then you might already have a setting that lets you set the number of products per page in your WooCommerce shop.

So, before jumping to the solution part, check your theme’s options for something like this:

avada number of products per page in woocommerce

This is how it looks on the Avada theme (affiliate link).

You can usually find your theme’s settings in Appearance > Theme Options or in Appearance > Customize if the developers integrated them there.

In case your WordPress theme doesn’t support WooCommerce, then I’ll show how to add a simple code that gets the job done.

Yes, if it’s possible and easy, we’ll be using a code, not a plugin 😀 . The fewer plugins you have, the better!

Change the number of products per page in WooCommerce

Before beginning, I recommend backing up the functions.php file or the entire website, as well as having a child theme in place, otherwise, the changes you make will disappear with the next theme update!

If you don’t have a child theme and it would be too complicated for you to set up one now, then you should use the Code Snippets plugin and add the code there.

Now, let’s get to it!

Step 1 – Access the functions.php file

Access your WordPress website’s files and edit the child theme’s functions.php file.

edit functions.php cpanel

Editing functions.php via cPanel

It should normally be in /public_html/wp-content/themes/YourThemeName-child/functions.php.

If you’re using an add-on domain, not your main one, then it should be in /public_html/YourDomain/wp-content/themes/YourThemeName-child/functions.php.

Step 2 – Add the filter

Add the following PHP code (provided by the Woo devs) at the very bottom of the file or right before the ?> closing tag (if it exists).

Copy to Clipboard

 

functions.php woocommerce change number of products per page

Don’t forget to update/save the file!

This filter will display 9 products per page.

To modify that number, simply change the value in $cols = 9;.

For example, if you want to display 12 products per page, then add 12 instead of 9: $cols = 12;.

That’s a wrap

I hope you found the post useful and managed to change the number of products displayed per page in your WooCommerce shop!

Don’t forget to share the post to help out others!

You can quickly subscribe to my newsletter by using this link.

If you have any questions or thoughts, drop a comment or send a message via contact or Facebook page.

You can also hit the follow button on Twitter and subscribe to the YouTube channel.

My WordPress installation service is at your disposal!

On-going WordPress support and maintenance services are on the menu as well!

WP Rocket - WordPress Caching Plugin
By |2018-12-03T22:38:08+00:00November 29th, 2018|Customization, Plugins|0 Comments

Leave A Comment

SUBSCRIBE BEFORE YOU GO?

- Get guides and offers right into your inbox -

The type of emails that you would like to receive (multiple selection allowed):

You can unsubscribe at any time by clicking the link in the footer of the emails. For more information, please check the privacy policy.

I use MailChimp as my emailing service. By subscribing, you understand that your email and preferences will be transferred to MailChimp. Learn more about MailChimp's privacy practices here.

close-link