From: Laury GvR Date: Tue, 21 Feb 2017 21:29:21 +0000 (-0500) Subject: Hide drafts from frontpage product list X-Git-Tag: v1.0.15^2~1 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=427632cd3cb107daca241ddbaeb29f43fb6dc949;p=WP-Themes%2Fcapstone.git Hide drafts from frontpage product list --- 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 "
    ";