Title: Edit php child theme
Last modified: August 21, 2016

---

# Edit php child theme

 *  [cag8f](https://wordpress.org/support/users/cag8f/)
 * (@cag8f)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/edit-php-child-theme/)
 * How do I edit the php files (header, footer, etc) of a child theme without running
   into problems (i.e. having to re-do all my edits) if/when the theme is updated?
 * For example, if I edit the parent theme header.php to include some text, I will
   have to re-insert that once the parent theme is updated. I *could* copy the parent
   header.php to my child theme and then insert the text. But when the parent theme
   is updated, I’ll still need to copy the new parent header.php to my child theme,
   THEN re-insert the text. How do I get around this? Can I make such edits in my
   style.css (or another file) that will persist through parent theme updates?
 * Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Dave Naylor](https://wordpress.org/support/users/wpranger/)
 * (@wpranger)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/edit-php-child-theme/#post-4949420)
 * If you make any edits to the theme’s php templates, these should never be done
   in the parent theme and always done in the child. If the parent theme is updated,
   run a diff tool (GUI or CLI) over the two directories, parent and child, to see
   what changes have been made. You will see your edits as well as any new parent
   changes. You can then re-create your edits in the new parent template or mirror
   the parent edits in your child.
 * Theme files generally aren’t updated with the same frequency as plugin files 
   so the task of checking for changes shouldn’t be too arduous.
 *  [Machine2240](https://wordpress.org/support/users/machine2240/)
 * (@machine2240)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/edit-php-child-theme/#post-4949431)
 * [http://codex.wordpress.org/Child_Themes](http://codex.wordpress.org/Child_Themes)
 *  Thread Starter [cag8f](https://wordpress.org/support/users/cag8f/)
 * (@cag8f)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/edit-php-child-theme/#post-4949445)
 * Thanks Dave. So either way, when my theme gets updated, I have to actively do
   something (review, edit, etc) to my edited PHP files (as opposed to style.css,
   which I can leave alone and not worry about). Just want to be sure.
 *  [Dave Naylor](https://wordpress.org/support/users/wpranger/)
 * (@wpranger)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/edit-php-child-theme/#post-4949504)
 * Yes that’s it. To the best of my recollection (a_ bit dubious at the best of 
   times_) I’ve never had an issue with an updated parent theme affecting a child.
   Nevertheless, I always run a diff tool, just to see what changed anyway.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Edit php child theme’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 3 participants
 * Last reply from: [Dave Naylor](https://wordpress.org/support/users/wpranger/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/edit-php-child-theme/#post-4949504)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
