From e61f89b5743e472e607e42c95b1a6f53bf084e5e Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Thu, 18 May 2017 09:09:13 -0400 Subject: [PATCH] Increased products per page on the shop to 12 (from 10) for a better layout --- functions.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/functions.php b/functions.php index 0d604f6..fb4e4d3 100644 --- a/functions.php +++ b/functions.php @@ -283,7 +283,7 @@ add_filter('glm-has-trail-product', function($member_id) { foreach ($posts as $post) { // Explode the (hopefully) comma-separated list of member IDs into an array $member_ids_for_product = explode(',', get_field( 'trail_id', $post->ID ) ); - + // If the current member is in the list of IDs if (in_array($member_id, $member_ids_for_product)) { return true; @@ -295,5 +295,13 @@ add_filter('glm-has-trail-product', function($member_id) { add_action('thematic_searchloop', 'mytheme_search_loop'); // End of the Contextual/Highlight Search functions +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 = 12; + return $cols; +} ?> -- 2.17.1