From 427632cd3cb107daca241ddbaeb29f43fb6dc949 Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Tue, 21 Feb 2017 16:29:21 -0500 Subject: [PATCH] Hide drafts from frontpage product list --- parts/shop-cats-and-products.php | 5 ++--- sections/front-page.php | 8 ++------ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/parts/shop-cats-and-products.php b/parts/shop-cats-and-products.php index 9d09c81..f752d33 100644 --- a/parts/shop-cats-and-products.php +++ b/parts/shop-cats-and-products.php @@ -18,14 +18,13 @@ 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()) { ?> diff --git a/sections/front-page.php b/sections/front-page.php index a1f3c3a..9890024 100644 --- a/sections/front-page.php +++ b/sections/front-page.php @@ -35,12 +35,9 @@
$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); @@ -68,14 +65,13 @@ 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 "
    "; -- 2.17.1