Reduce related products to 3, don't show uncategorized cat in sidebar
authorLaury GvR <laury@gaslightmedia.com>
Tue, 14 Aug 2018 18:53:35 +0000 (14:53 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Tue, 14 Aug 2018 18:53:35 +0000 (14:53 -0400)
functions.php
parts/shop-cats-and-products.php
style.css

index c30e5a7..b1dea8c 100644 (file)
@@ -153,11 +153,28 @@ function is_post_type($type){
 add_action('thematic_searchloop', 'mytheme_search_loop');
 // End of the Contextual/Highlight Search functions
 
+//  declare Woocommerce support
 add_action( 'after_setup_theme', 'woocommerce_support' );
 function woocommerce_support() {
     add_theme_support( 'woocommerce' );
 }
 
+/**
+ * Change number of related products output
+ */ 
+function woo_related_products_limit() {
+    global $product;
+      
+      $args['posts_per_page'] = 3;
+      return $args;
+  }
+  add_filter( 'woocommerce_output_related_products_args', 'related_products_args' );
+    function related_products_args( $args ) {
+      $args['posts_per_page'] = 3; // 4 related products
+      $args['columns'] = 3; // arranged in 2 columns
+      return $args;
+  }
+
 // The GLM Simple Messageboard needs this function to display its data
 if ( !function_exists( 'glm_get_simplemessageboard_option' ) ) {
     function glm_get_simplemessageboard_option( $option_name ) 
index d8ee7e7..963887f 100644 (file)
@@ -33,7 +33,8 @@
          'orderby'    => 'title',
          'order'      => 'ASC',
          'hide_empty' => false,
-         'parent'     => 0
+         'parent'     => 0,
+         'exclude'    => 134
     );
     $categories = get_terms( 'product_cat', $cat_args );
     $count = count($categories);
index 22c68b1..baebd9a 100644 (file)
--- a/style.css
+++ b/style.css
@@ -3,5 +3,5 @@ Theme Name: CornwellsTurkeyville
 Author: Gaslight Media
 Author URI: http://www.gaslightmedia.com
 Description: A theme for CornwellsTurkeyville
-Version: 1.0.17
+Version: 1.0.18
 */