about uscontact

How to Change the Number of WooCommerce Products Displayed Per Page

Category:
Author: zemna
Date: August 6, 2022
Share this:

If you want to change the number of products dispalyed per page in WooCommerce,
There is no option to do this easily.

You can do this by adding your Code Snippets.

1. Install Code Snippets Plugin

I'm using WPCode to manage code snippets in WordPress. Install and activate it.

2. Add new snippet

Click [Code Snippets] -> [+ Add Snippet] menu from left side menu.

And create new snippet using [Add Your Custom code (New Snippet)].

Select 'Add Your Custom Code (New Snippet)' from library in WooCommerce.
Select 'Add Your Custom Code (New Snippet)'

Set title as your want, select Code Type to PHP Snippet.

And Insert below code

// Change the Number of WooCommerce Products Displayed Per Page
add_filter( 'loop_shop_per_page', 'my_loop_shop_per_page', 30 );
function my_loop_shop_per_page( $products ) {
 $products = 15;
 return $products;
}

Save and Activate your new snippet.

Share this:

Leave a Reply

Your email address will not be published.

ZEMNA.NET

Professional software development agency estalished in Indonesia. We offers website setup, web application development, fulfillment service, and etc.
Follow us
Follow us to get latest news and tutorials.
2022 - Copyright, All Rights Reserved, Made by ZEMNA.NET with ❤️
magnifiercrossmenu