Adjusting the inside shop sidebar category display to show the new Category
authorLaury GvR <laury@gaslightmedia.com>
Wed, 28 Jun 2017 14:40:10 +0000 (10:40 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Wed, 28 Jun 2017 14:40:10 +0000 (10:40 -0400)
parts/shop-cats-and-products.php

index 385d7ea..b428f66 100644 (file)
@@ -1,14 +1,13 @@
 
 
 <?php
-        $excluded_cat = get_term_by( 'slug', 'whitepapers', 'product_cat' );
-        $excluded_cat_id = $excluded_cat->term_id;
-        $args = array(
-         'orderby'    => 'title',
-         'order'      => 'ASC',
-         'hide_empty' => false,
-         'exclude'    => $excluded_cat_id
-
+    $excluded_cat = get_term_by( 'slug', 'whitepapers', 'product_cat' );
+    $excluded_cat_id = $excluded_cat->term_id;
+    $args = array(
+     'hide_empty' => false,
+     'exclude'    => $excluded_cat_id,
+     'orderby'    => 'menu_order',
+     'order'      => 'ASC',
     );
     $product_categories = get_terms( 'product_cat', $args );
     $count = count($product_categories);
@@ -18,6 +17,7 @@
                 'posts_per_page' => -1,
                 'tax_query' => array(
                     'relation' => 'AND',
+
                     array(
                         'taxonomy' => 'product_cat',
                         'field' => 'slug',
                 'post_status' => 'publish',
                 'orderby' => 'menu_order',
                 'order' => 'ASC',
-                'meta_query' => array(
-                    array(
-                        'key'       => '_visibility',
-                        'value'     => 'hidden',
-                        'compare'   => '!=',
-                    )
-                )
             );
             $products = new WP_Query( $args );
             if ($products->have_posts()) { ?>