Read a theme file
read_theme_fileFetch a WordPress theme file's contents to review code before making changes, providing the exact text needed for reliable edits.
Instructions
Read the contents of one theme file. Always read before editing — write_theme_file replaces the whole file, and edit_theme_file needs exact text to match.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path relative to the theme root, e.g. "functions.php" or "template-parts/hero.php". | |
| theme | No | Theme stylesheet or draft id. Defaults to the active theme. | |
| 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. | |
| max_chars | No | Truncate very large files at this many characters. |