Title: Altering .php files
Last modified: August 20, 2016

---

# Altering .php files

 *  [words2us](https://wordpress.org/support/users/words2us/)
 * (@words2us)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/altering-php-files/)
 * I want to make changes to some .php files on my domain, but I was just wondering
   whether any changes I made directly to these files would be lost if the theme
   I am using is reinstalled or updated. At the moment I am using a child theme 
   with a style.css that imports the code for the style.css in the parent theme,
   but is it possible to do the same with .php files and just make a sidebar.php
   in my child theme and import the code from the sidebar.php from the parent theme,
   for example?
 * Sorry if I’m not explaining myself very well or I’m asking a stupid question,
   but I’m new to all this.

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

 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [14 years, 1 month ago](https://wordpress.org/support/topic/altering-php-files/#post-2662212)
 * > I was just wondering whether any changes I made directly to these files would
   > be lost if the theme I am using is reinstalled or updated.
 * If you modified core files and/or parent theme files, yes the changes would be
   lost when an update happens.
 * > At the moment I am using a child theme with a style.css that imports the code
   > for the style.css in the parent theme, but is it possible to do the same with.
   > php files and just make a sidebar.php in my child theme and import the code
   > from the sidebar.php from the parent theme, for example?
 * Not import, but make duplicate copies of the parent theme files that you want
   to modify and put those copies into your child theme directory.
 * As long as the files are standard template file names or loaded via `get_template_part()`
   then your child theme’s copies will be loaded instead of the parent theme copies.
 * [http://codex.wordpress.org/Child_Themes#Template_files](http://codex.wordpress.org/Child_Themes#Template_files)
 * > Sorry if I’m not explaining myself very well or I’m asking a stupid question,
   > but I’m new to all this.
 * Nope, it’s all good. 🙂
 *  Thread Starter [words2us](https://wordpress.org/support/users/words2us/)
 * (@words2us)
 * [14 years, 1 month ago](https://wordpress.org/support/topic/altering-php-files/#post-2662216)
 * Thanks Jan, that’s really helped. 🙂

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

The topic ‘Altering .php files’ is closed to new replies.

## Tags

 * [altering](https://wordpress.org/support/topic-tag/altering/)
 * [child theme](https://wordpress.org/support/topic-tag/child-theme/)
 * [css](https://wordpress.org/support/topic-tag/css/)
 * [parent theme](https://wordpress.org/support/topic-tag/parent-theme/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [words2us](https://wordpress.org/support/users/words2us/)
 * Last activity: [14 years, 1 month ago](https://wordpress.org/support/topic/altering-php-files/#post-2662216)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
