//Check if the page is a category one and display the current category id and slug..
if ( is_category()) {
$cat = get_query_var(‘cat’);
$currentcat = get_category ($cat);
echo ‘current category id is ‘. $yourcat . ‘
‘;
echo ‘current category slug is ‘. $yourcat->slug
}
Advertisement