Skip to content

Instantly share code, notes, and snippets.

@kodie
Last active November 25, 2015 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kodie/0a5ad7724243c07860d1 to your computer and use it in GitHub Desktop.
Save kodie/0a5ad7724243c07860d1 to your computer and use it in GitHub Desktop.
Find out what template file a page is using
function show_current_template($wp_admin_bar) {
global $template;
$args = array(
'id' => 'current_template',
'title' => 'Current Template: '.basename($template),
'meta' => array('title'=>$template)
);
$wp_admin_bar->add_node($args);
}
if (current_user_can('manage_options') && !is_admin()) { add_action('admin_bar_menu', 'show_current_template', 9999); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment