I tried to show just products of the current category in page category.php.
<?php if (get_sub_field(‘categoria_produtos->name’) == ‘take currently category’): ?>
‘categoria_produtos->name’ = name the product category
The code above I use for taking name current category, but it doesn’t work when I use the variable $current_cat->name inside the loop statement.
<?php
$category = get_query_var(‘cat’);
$current_cat = get_category($cat);
echo $current_cat->name;
?>