WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Child Theme vs. Copy Entire Theme folder (7 posts)

  1. TropolisGroup
    Member
    Posted 2 years ago #

    I'm using the Twenty Eleven theme for some web sites. I've installed numerous plugins that extend and modify the theme. I'm concerned that when it comes time to upgrade WordPress I'll lose my modifications.

    I've seen some comments about creating a child theme to avoid losing my mods. but the articles only talk about adding a style.css file in the child folder.

    Is there a good reason not to just copy the entire twentyeleven folder to another named folder and use that 'theme?'

    Thank you!

  2. zeaks
    Member
    Posted 2 years ago #

    Copying the folder and renaming it is at least better than editing the original.
    The best is to use a child theme, then your changes are easy to see, will never be overwritten during an upgrade of WordPress and your child theme will continue to receive updates to the parent theme.

  3. TropolisGroup
    Member
    Posted 2 years ago #

    Okay, so if I understand correctly I just create the addl. folder under Themes then copy the style.css from parent theme into the child folder then modify the header of style.css to point back to its' parent.

    But as I continue to add plugins, theme extensions, manually modify theme files, etc. do I need to "manually" decide when to copy more files from parent to child for modification, or this happens automatically? For example, let's say I want to manually modify footer.php. Should I first copy orig. parent theme file to child then modify?

    Thanks so much!

  4. mrwweb
    Member
    Posted 2 years ago #

    TropolisGroup. Yes.

    Whenever you want to modify a file, copy it to the child theme folder and then modify it.

    The codex page on child themes is great and you'll also want to get up to speed on the "Template Hierarchy."

  5. zeaks
    Member
    Posted 2 years ago #

    You don't need to copy the entire style.css, the only thing you need is a folder, and your own style.css with this info in it.

    /*
    Theme Name: My Cool Theme
    Theme URI: http://yoursite/yourtheme
    Description: A child theme of 2010-11 default WordPress theme.
    Author: You
    Author url: http://yoursite.com/
    Version: 1.0
    Tags: black, blue, white, fixed-width, custom-header, theme-options
    Template: twentyeleven
    */
    @import url("../twentyeleven/style.css");

    Then you add your custom CSS. (makes it much easier to see your changes than adding the entire stylesheet)

    If you modify a file, for Example - In my theme I changed content.php to use excerpts on the main page.

    So I Copied content.php to my child theme folder and made my changes to that.

    Your child theme will use any files in its folder, if they are not there it will look to the parent theme and use those instead.

  6. mrwweb
    Member
    Posted 2 years ago #

    I should've read more carefully. Zeaks is 100% right. Using the @import method is the way to go.

  7. TropolisGroup
    Member
    Posted 2 years ago #

    Thanks for all the input!

    On another note:
    What's this Showcase template included in the Twenty Eleven theme? Looks like it just includes Recent Posts on the page without a sidebar. I guess the intention is that we modify it to our liking if we know how to modify templates?

Topic Closed

This topic has been closed to new replies.

About this Topic