How to display subcategories in level 2?

There are 3 levels of nested categories

Clothing and shoes:
Men:
-Clothing
Shoes
-Women:
-Clothing
Shoes

In this case, men and women
I got the current category like so:
$current_cat = get_queried_object();
$parent_cat = $current_cat->term_id;
$children_categories = get_term_children( $parent_cat, 'product_cat' );
if ( $children_categories ) { 
foreach($children_categories as $child_category) {
$term = get_term( $child_category, 'product_cat' );
print_r($term);
}

But in this case I can see all categories: clothing and shoes
How to display only 2-level sub-categories from apparel and shoes - men and women?
April 7th 20 at 10:41
0 answer

Find more questions by tags WordPressWooCommerce