Having trouble tracking down which theme template file is outputting the current page’s content?
Here’s a simple hook you can throw in your functions.php file to save you some time and headaches!
add_action('wp_head', 'show_template'); function show_template() { global $template; if (current_user_can('administrator')) echo basename($template); }
Notice we added a check to make sure the visitor is logged in with administrator privileges. If this is on a development site, just omit the if condition if you don’t want to have to be logged in to see the filename.
Hope that helps!