update = remove code

i updated my wordpress in 3.1 (i’m using twenty ten) and some of my code has been deleted, i’d like to understand it : is it only because i’m using the “twenty theme”, that the “code” was replaced with the new version? does a “new version” remove also the code if i use my own theme? and so : to have a code safe, the “plugin” folder is the only safe area?

I’d like to be confident the next time i update my version of wordpress.

Read More

Thanks

Related posts

Leave a Reply

2 comments

  1. At the moment, WordPress replaces core files when it updates. This will change in the future, but for now all core files get replaced, i.e. every file that comes with WordPress. This includes the default twenty ten theme.

    If you modify twenty ten you should save your modified theme with a different name. To do this, make a copy of the twentyten folder and rename this folder. Then, inside the renamed folder open styles.css and change the line Theme Name: Twenty Ten to Theme Name: Same Name as your Renamed Folder. Add this folder back into wp-content/themes and activate it in your admin settings.

    When WordPress updates it leaves your own themes alone, so you won’t lose the changes you made.

  2. I wrongly assumed that @Elpie meant to make a Child Theme.

    Therefore my answer now becomes that I suggest making a Child Theme of Twenty Ten to a. protect your changes for future updates and b. still have all the benefits that Twenty Ten offers now and in the future.

    To do so, you will also need to duplicate the twentyten folder and give it a different name. You also need to change the top part of the Twenty Ten style.css

    1. In the top of your style.css you will need to tell that you still use twentyten as the parent theme. So you will need to add a line: Template: twentyten

    2. Also at the top, but under the initial code you should import the twentyten stylesheet. You can do that by using this line of code:
      @import url("../twentyten/style.css");

    Eventually the top of your stylesheet should look similar to this:

    /*
    Theme Name: Twenty Ten Child
    Description: Child theme for the Twenty Ten theme 
    Author: Your name here
    Template: twentyten
    */
    
    @import url("../twentyten/style.css");
    

    All this and more on Child Themes in the Codex: http://codex.wordpress.org/Child_Themes