Increased products per page on the shop to 12 (from 10) for a better layout
authorLaury GvR <laury@gaslightmedia.com>
Thu, 18 May 2017 13:09:13 +0000 (09:09 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Thu, 18 May 2017 13:09:13 +0000 (09:09 -0400)
functions.php

index 0d604f6..fb4e4d3 100644 (file)
@@ -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;
+}
 
 ?>