List theme files
list_theme_filesList files in a WordPress theme or theme draft with their sizes to review the template structure before reading or editing. Identify the correct file by seeing the full hierarchy.
Instructions
List the files in a theme (or theme draft) with sizes, so you can see the template structure before reading or editing anything.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| theme | No | Theme stylesheet or draft id. Defaults to the active theme. | |
| subdir | No | Restrict the listing to this subdirectory, e.g. "template-parts". | |
| site_id | No | Which configured WordPress site to act on. Optional — with a single site configured it is used automatically; with several, the default site is used unless you name one. Run list_sites for valid ids. |