Display current category name

<?php

$current_cat_id = the_category_ID(false);
echo '<h1>' . get_cat_name($current_cat_id) . '</h1>';

?>

5 Comments

You must be logged in to post a comment.


  1. get_category(get_query_var('cat'))->name


  2. Great help 🙂


  3. Thank you verrrrrrrry much ! 🙂


  4. Good one! thanks a lot.


  5. Thank you very much for this perfect solution. I am using it in the <title tag in the <head section.