From fcd25df02d8755320e39d8ae0763120704690795 Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Fri, 2 Jun 2017 17:07:22 -0400 Subject: [PATCH] Changing the query for the front end category display --- parts/cats-and-products.php | 5 ++--- sections/front-page.php | 16 +++++----------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/parts/cats-and-products.php b/parts/cats-and-products.php index 9e7cc28..7cc4ae0 100644 --- a/parts/cats-and-products.php +++ b/parts/cats-and-products.php @@ -7,7 +7,7 @@ 'hide_empty' => $hide_empty, 'include' => $ids, 'exclude' => '18' - + ); $product_categories = get_terms( 'product_cat', $args ); $count = count($product_categories); @@ -20,7 +20,6 @@ array( 'taxonomy' => 'product_cat', 'field' => 'slug', - // 'terms' => 'white-wines' 'terms' => $product_category->slug ) ), @@ -32,7 +31,7 @@
- ' . $product_category->name . ''; echo "
    "; diff --git a/sections/front-page.php b/sections/front-page.php index a7b1ace..b3d99b6 100644 --- a/sections/front-page.php +++ b/sections/front-page.php @@ -36,7 +36,7 @@
    false, - 'exclude' => '18', + 'exclude' => '17', 'orderby' => 'menu_order', 'order' => 'ASC', ); @@ -55,14 +55,15 @@ */ do_action( 'woocommerce_before_subcategory_title', $product_category ); ?> -
    +
- ' . $product_category->name . ''; $args = array( 'posts_per_page' => -1, 'tax_query' => array( 'relation' => 'AND', + array( 'taxonomy' => 'product_cat', 'field' => 'slug', @@ -73,13 +74,6 @@ 'post_status' => 'publish', 'orderby' => 'menu_order', 'order' => 'ASC', - 'meta_query' => array( - array( - 'key' => '_visibility', - 'value' => 'hidden', - 'compare' => '!=', - ) - ) ); $products = new WP_Query( $args ); echo "
    "; @@ -106,7 +100,7 @@
- +