Last active
September 18, 2020 18:44
-
-
Save mmh4560/24c2e61efa6f63668dcb2d8fde5094f4 to your computer and use it in GitHub Desktop.
This file contains 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
// Woocommerce Show All products on Shop page | |
/** | |
* 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 = -1; | |
return $cols; | |
} | |
// Woocommerce Show 4 Column in products | |
add_filter( 'loop_shop_columns', 'new_cl_loop_columns_per_page', 20 ); | |
/** | |
* How many columns per page | |
* @since 1.0.0 | |
*/ | |
function new_cl_loop_columns_per_page( $cols ) { | |
// Return the number of columns you want show per page. | |
$cols = 4; | |
return $cols; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment