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

To customize a theme , it is not always easy to trace every files that are used and find out which one do what .
For example i’ like to find out how my menu is generated so i can add some conditions to it , and also change the display.
Is there a way to find out all the files loaded ? which header is used …etc…
maybe put a bit of code somewhere in the autoload sytem? or using firebug?

Related posts

2 comments

  1. 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.

  2. There Is no method known to me.
    I would suggest you to set yourself apart with the file hierarchy and to learn bit by bit where the functions are written.

    And use the codex to search for functions.
    It can give you information about the file in which your desired function is included.

Comments are closed.