<?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);
'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()) { ?>