Skip to content

Instantly share code, notes, and snippets.

@wycks
Created May 6, 2012 19:44
Show Gist options
  • Save wycks/2624062 to your computer and use it in GitHub Desktop.
Save wycks/2624062 to your computer and use it in GitHub Desktop.
Output wordpress template in footer source code
<?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 . '-->';
}
?>
@franz-josef-kaiser
Copy link

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} -->"; :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment