1function define_current_theme_file( $template ) {
2 $GLOBALS['current_theme_template'] = basename($template);
3
4 return $template;
5}
6add_action('template_include', 'define_current_theme_file', 1000);
7
8# Echo result in header.php
9echo $GLOBALS['current_theme_template'];