現在のカテゴリーの情報を取得する

◯取得

<?php
  $cat = get_the_category();
  $cat = $cat[0];
  $cat_name = $cat->name;
  $cat_id   = $cat->cat_ID;
  $cat_slug = $cat->slug;
  $cat_term = $cat->term_id;
  $cat_termid   = $cat->term_taxonomy_id;
  $cat_taxonomy = $cat->taxonomy;
  $cat_count   = $cat->count;
  $cat_description   = $cat->category_description;
  $parent_id = $cat->category_parent;
  $parent = get_category($cat->category_parent);
  $parent_catname = $parent->cat_name;
?>

◯出力