Skip to content

Instantly share code, notes, and snippets.

@decodigo
Created July 16, 2013 16:27
Show Gist options
  • Save decodigo/6010290 to your computer and use it in GitHub Desktop.
Save decodigo/6010290 to your computer and use it in GitHub Desktop.
Snippet to show which template is currently being used.
<?php
add_action('wp_footer', 'show_template');
function show_template() {
global $template;
echo '<div style="width: 50%; margin: 40px auto; font-size: 12px; color: #c09853; background-color: #fcf8e3; border: 1px solid #fbeed5;padding: 2em; border-radius: 4px;"><p><strong>Current Template</strong></p><em>';
print_r(str_replace(get_template_directory(), '', $template) );
echo '</em></div>';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment