display category wise product in woocommerce – How to display products by category in WooCommerce?

display category wise product in woocommerce – Group your products into relevant categories. Show products from current product category programmatically,

How to Display Category Wise Product in Woocommerce?

here We will display you how we can display woocommerce query products by category.

display woocommerce products by specific categories.

$args = array(
    'post_type'      => 'product',
    'posts_per_page' => 20,
    'product_cat'    => 'bags'
);
$results = new WP_Query( $args );
while ( $results->have_posts() ) : $results->the_post();
    global $product;
    echo '<br /><a href="'.get_permalink().'">' . woocommerce_get_product_thumbnail().' '.get_the_title().'</a>';
endwhile;
wp_reset_query(); 

Go to WooCommerce > Settings,

Read Also:  PHP MySQL Autocomplete textbox using jQuery

and then select the Products tab, after that select the Display option.

For each of the Shop Page Display as well as Default Category Display options,

select Show both.

Woocommerce show each categories with their products

first of all make a new shop page. and then you can use the woocommerce shortcodes.

Don’t miss: Woocommerce Get Product Category Name In Array

Read Also:  Laravel 6 Localization tutorial example - PHP

<h2>Category Name</h2>
[product_category category="yourcatname" per_page="10" columns="3" orderby="date" order="desc"]

I hope you get an idea about display category wise product in woocommerce.
I would like to have feedback on my infinityknow.com.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.