Forked from woogists/wc-products-displayed-per-page.php
Created
October 3, 2020 19:09
-
-
Save bobwol/6d40eaeb633e42f34ea7be6ada5f55e8 to your computer and use it in GitHub Desktop.
[Theming Snippets] Change number of products displayed per page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Change number of products that are displayed per page (shop page) | |
| */ | |
| add_filter( 'loop_shop_per_page', 'new_loop_shop_per_page', 20 ); | |
| function new_loop_shop_per_page( $cols ) { | |
| // $cols contains the current number of products per page based on the value stored on Options -> Reading | |
| // Return the number of products you wanna show per page. | |
| $cols = 9; | |
| return $cols; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment