<?php
  if (is_user_logged_in()) {
    global $template;
    $template_dir = basename(dirname($template));
    $template_name = basename($template, '.php');
    echo 'テーマ:' . $template_dir;
    echo 'テンプレート:' . $template_name;
  }