Wordpress Get current category id – WordPress May 31, 2011 Pramod T P Leave a comment <?php function getCurrentCatID(){ global $wp_query; if(is_category() || is_single()){ $cat_ID = get_query_var(‘cat’); } return $cat_ID; } echo $getCurrentCatID(); ?>