I am working on a listing of subcategories for Woocommerce and I am stuck,
The code for the product loop
<?php
$args = array ( 'post_type' => 'product', 'stock' => 1, 'posts_per_page' => 12, 'product_cat' => '2', 'orderby' => 'date','order' => 'DESC' );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post(); global $product; ?>
<li>
<a id="id-<?php the_id(); ?>" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><h3 ><?php the_title(); ?></h3></a>
</li>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
But I can not find a decent way to simply get a listing of the sub-product-categories instead of the products.
Thanks in advance
By ID:
By Name:
Source / Inspiration