We design and develop websites, digital experiences, and software solutions for growing businesses.
The current category ID is in the global $cat variable, when you are in a category page you can get it as follows.
<?php if (is_category()) { $category = get_category(get_query_var('cat')); $cat_id = $category->cat_ID; } ?> |