Created
November 17, 2012 07:42
-
-
Save jasontucker/4094074 to your computer and use it in GitHub Desktop.
Display template name of the page you are currently on at the top of the page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's also a hook for changing the template that's being included for bonus points.