This is another super simple and yet super helpful WordPress function that took me a while to find. I’m currently working on a WP Theme that requires me to show the category name. And I thought it isn’t right to write an SQL including all the necessary stuffs that comes with querying the database just to get the category name. There must be a simpler and better way… and there is! Here’s the simple code to do just that.
<?php get_cat_name( $cat_id ); ?>