Return to Snippet

Revision: 29482
at July 30, 2010 06:05 by S_Park


Initial Code
<?php if (is_category()) {
  global $wp_query;
  $cat_obj = $wp_query->get_queried_object();
  echo $cat_obj->name . " has id ". $cat_obj->term_id;
} ?>

Initial URL


Initial Description


Initial Title
Wordpress: Get current category ID and name

Initial Tags
wordpress, category

Initial Language
PHP