Created
May 6, 2012 19:44
-
-
Save wycks/2624062 to your computer and use it in GitHub Desktop.
Output wordpress template in footer source code
This file contains 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
<?php | |
// this is handy for debugging live site, out puts page template in footer source code. | |
add_action('wp_footer', 'show_template'); | |
function show_template() { | |
global $template; | |
echo '<!-- the template is:' . $template . '-->'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If it's a live site, I guess it should contain something like
defined( 'WP_DEBUG' ) and WP_DEBUG and current_user_can('manage_options') print "<!-- Template: {$template} -->";
:)