• words2us

    (@words2us)


    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

    (@jdembowski)

    Forum Moderator and Brute Squad

    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

    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

    (@words2us)

    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.