Created
February 13, 2014 21:41
-
-
Save codescribblr/8984461 to your computer and use it in GitHub Desktop.
Template Finder for Wordpress
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
| add_action( 'wp_head', 'show_me_the_template' ); | |
| function show_me_the_template() { | |
| global $template, $current_user, $wp_admin_bar; | |
| get_currentuserinfo(); | |
| /* If you have more than one user deny. Be sure to use your user ID! */ | |
| if ( !is_user_logged_in() && $current_user->ID != '1' ) | |
| return; | |
| if ( is_admin_bar_showing() ) | |
| $wp_admin_bar->add_menu( array( | |
| 'parent' => false, | |
| 'id' => 'template', | |
| 'title' => $template, | |
| 'href' => '#' | |
| )); | |
| else | |
| print_r( $template ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment