I have a WP_Query that outputs products from given Product category name. For each product list I would also like to link to the category of that product, but I'm not sure how.
<?php $new_posts = new WP_Query([ 'product_cat' => 'printer', 'post_type' => 'product', 'orderby' => 'meta_value_num', 'order' => 'DESC', 'meta_key' => 'view_count', 'posts_per_page' => 9, ]); ?>
Output link something like this:
<a href="<?php echo $cat_id ?>" class="procat-link">More Products...</a>