How to get current product category ID in product archive page

I solve This To get the current category ID.

$cate = get_queried_object();
$cateID = $cate->term_id;
echo $cateID;

and it works like a charm.

Leave a Comment