is there a simple way to list every templates / php files used to generate a specific page?

WordPress does not really track what theme files are loaded beyond some basic things (for example $template global holds main template file).

You can use PHP’s native get_included_files() to list all PHP source files loaded during request and narrow it down to your theme. Note that for more complex themes this will have not only templates, but likely a lot of framework files as well.

Leave a Comment