Hide drafts from frontpage product list
authorLaury GvR <laury@gaslightmedia.com>
Tue, 21 Feb 2017 21:29:21 +0000 (16:29 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Tue, 21 Feb 2017 21:29:21 +0000 (16:29 -0500)
parts/shop-cats-and-products.php
sections/front-page.php

index 9d09c81..f752d33 100644 (file)
                     array(
                         'taxonomy' => 'product_cat',
                         'field' => 'slug',
-                        // 'terms' => 'white-wines'
                         'terms' => $product_category->slug
                     )
                 ),
                 'post_type' => 'product',
-                'post_status' => 'published',
                 'orderby' => 'menu_order',
-                'order' => 'ASC'
+                'order' => 'ASC',
+                'perm' => 'readable'
             );
             $products = new WP_Query( $args );
             if ($products->have_posts()) { ?>
index a1f3c3a..9890024 100644 (file)
     <div class="block-row">
         <div id="front-shop" class="block-column row small-up-1 medium-up-2 large-up-4" data-equalizer>
         <?php $args = array(
-             'number'     => $number,
             'post_status' => 'published',
              'orderby'    => 'menu_order',
              'order'      => 'ASC',
-             'hide_empty' => $hide_empty,
-             'include'    => $ids
         );
         $product_categories = get_terms( 'product_cat', $args );
         $count = count($product_categories);
                                     array(
                                         'taxonomy' => 'product_cat',
                                         'field' => 'slug',
-                                        // 'terms' => 'white-wines'
                                         'terms' => $product_category->slug
                                     )
                                 ),
                                 'post_type' => 'product',
-                                'post_status' => 'published',
                                 'orderby' => 'menu_order',
-                                'order' => 'ASC'
+                                'order' => 'ASC',
+                                'perm' => 'readable'
                             );
                             $products = new WP_Query( $args );
                             echo "<ul>";