WooCommerce has a level of flexibility which makes it one of the most popular plugins among developers and website owners who need an eCommerce website. It helps you build a functional website that can be easily customized to help you achieve your targets. This WordPress plugin is known for its seamless integration with WordPress and its ability to make online shopping a breeze for the end users.
If you use WooCommerce and you are trying to figure how to change the number of posts on WooCommerce product pages, then you must add a code in the functions.php file which will help you change the number of products you see in one page. You can modify the code to reflect the number of products you want to display in one page.
Open the functions.php file of your theme by going to Editor and then clicking on Theme and Functions to find the file. Now add the following code to the functions.php file:
//Display 24 products on archive pages add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 24;' ), 20 )
Your page will now be able to show 24 posts in one page. This is because the number after Display and return are selected as 24. You can change the number of posts by simply changing the number to one of your choice. For example, if you were to replace the number 24 with the number 1, then you will see one post per page. By adding this code, you will be able to easily organize your website posts so that they show up in a proper format. This is paginating the posts on your product page.
For those who didn’t know, WordPress helps you manage the number of posts displayed on a page under the reading settings. You simply need to navigate to the Settings page of your theme and then clock on Reading to reach the Reading Settings. Now look for the option that says “Blog pages show at most”. Next to this you have the option of changing the number of posts that will show on your product page.
Using these two methods, you can pick the number of posts you would like to display on the WooCommerce product pages. Both these methods are easy and they can help you set up the number of posts displayed on a page quickly and efficiently.