What file is this page using? – What The File


When I started off with WordPress I had trouble finding out what file I needed to edit to change the page I was viewing in my browser. I’ve checked the Template Hierarchy dozens of times, trying to figure out what file was loaded by WordPress to display my page.

What The File

I figured that I wasn’t the only one with this problem, everyone starts a beginner. In time you can dream the WordPress Template Hierarchy, but until then you might want to check out a plugin I wrote called What The File.


What The File adds an option to your toolbar showing you what file is used to display the page you’re on. If you want to you can click the file name to edit it directly through the theme editor, though I don’t recommend this for bigger changes. Since version 1.1.0 What The File also supports Roots Theme based themes.

What The File can be downloaded from the WordPress Plugin Directory or by clicking here. For support please visit the Support forum.

Related Posts

Powered By Related Posts for WordPress
Related Posts for WordPress

20 thoughts on “What file is this page using? – What The File

  1. […] What file is this page using? – The WordPress Template Hierarchy » […]

  2. Yes! Thank you! I was looking for something like this when I first started themeing pages, I’m sure this will come in handy for a lot of people.

  3. Good one. I would recommend one minor improvement.

    Line 86:
    global $current_user;

    change to

    $current_user = wp_get_current_user();

    Than you’ll miss the “Notice: Trying to get property of non-object in xxx\wp-content\plugins\what-the-file\what-the-file.php on line 87″ message in WP Debug mode.

  4. I love the concept of the plugin, and installed it as soon as I found it.

    Alas, I’m not loving what it does. Or I should say doesn’t do.

    If there’s been an option added to my toolbar to show me the file I’m on, I’m sure not seeing it. Desperately want to though!

  5. Much needed! Thank you very much :-)

  6. Very helpful Plugin. Thank you very much

  7. Thank you! Exactly what I needed!

  8. Love this , quick question in most themes it shows fine but some themes it dont show at all, could that be cuz the theme is dark? what in a particular theme will cause it not to show. I already checked ADMIN USER to make sure that Show Toolbar when viewing site is CHECKED.. The theme has a admin area cuz it allow to check in logged in as admin so users can upload videos. If not logged in as admin them changed to login.

  9. found the answer in functions.php i removed code in there that was turning off admin bar overriding anything i was doing. Removed it now works, sorry for bothering you. Great plugin, i use it on all my test sites. Its wonderful especially on more complex pages that use multiple parts of a theme.

    /*function fw_wp_hide_admin_bar(){
    return false; TODD TURNED OFF

    add_filter('show_admin_bar' ,'fw_wp_hide_admin_bar');

  10. Excellent plugIn! Thank you for creating it. Much appreciate it.

  11. Thanks a lot man, your plugin has saved me so much debugging time! Otherwise I would hack every page on the site before finding which one was it finally using

  12. This is a very handy plugin. Thanks for saving me lots of time figuring out intrusive themes that try to do everything on its own.

  13. Hi Barry,

    Great plugin, for the ones who get it to work ;-)
    I left a question on the WP forum, hope you can help me out….



  14. Fantastic!!! Thank you :)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>