Forked from ericrasch/Detect WordPress template file.php
Created
July 4, 2017 03:53
-
-
Save johanoloflindberg/30b038bff3bb8a4d1f1e795e94d09731 to your computer and use it in GitHub Desktop.
Detect + display WordPress template file being used
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
<?php | |
/** | |
* Detect + display WordPress template file being used | |
* REF: http://www.wpmayor.com/output-name-of-wordpress-template-file-being-used/#comment-8221 | |
*/ | |
add_action('wp_head', 'show_template'); | |
function show_template() { | |
global $template; | |
global $current_user; | |
get_currentuserinfo(); | |
if ($current_user->user_level == 10 ) print_r($template); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment