WordPress uses a variable $template to store the template being used. Therefore, for debugging (not recommended for a live site), you can put this in your theme’s functions.php:

add_action('wp_head', 'show_template');
function show_template() {
	global $template;
	print_r($template);
}
Advertisements