Skip to content

Instantly share code, notes, and snippets.

@mrl22
Forked from brendonexus/Wordpress current template hook
Created April 6, 2017 11:15
Show Gist options
  • Save mrl22/23790fdae793b158ae4534c78da9e4dc to your computer and use it in GitHub Desktop.
Save mrl22/23790fdae793b158ae4534c78da9e4dc to your computer and use it in GitHub Desktop.
Wordpress current template hook
add_action('get_footer', 'show_template');
function show_template()
{
global $template;
if ($_SERVER['REMOTE_ADDR'] == 'ip_address') echo basename($template);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment