child themes and updates

Community Forums Forums Design Tips and Tricks child themes and updates

This topic is: not resolved

This topic contains 13 replies, has 6 voices, and was last updated by  David Chu 4 months, 3 weeks ago.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #102712

    Chrys
    Member
    Post count: 38

    Hi,

    I am pretty new to studiopress and I have a question about child theme.
    Actually, when I used to buy premium themes on theme forest for example, I used to make a child theme for each one so that when there is an update all my customization are not lost.
    But on Genesis, there is the framework that can be update (here no problem because the css is link to the child theme) but if the child theme is updated (I don’t know if that happens??) if I made changes what happens? Because I cannot make a child theme of a child theme…

    I hope it’s not a silly question but I’m new with framework and eager to learn more.

    Kind regards

    Chrys

    #102725

    David Chu
    Participant
    Post count: 1428

    Chrys,
    Great question, and one that every Genesis child theme customizer runs into eventually. In fact, people have asked if they should use a “child of a child” theme. :-) Supposedly some people have worked that out, but I haven’t seen it in the wild.

    You are correct in that a child theme update may remove your cool custom stuff! So what you do to deal with that depends on your tastes.

    You could back up your child theme, do the update, do a code compare, and thread your stuff back in. A bit tedious, but not huge if you only made a few changes. If you put comments in there, it will be easier to do the re-threading!

    I take it a bit further, as I’m often asked for serious modifications. In that case I will make a custom functions file and a custom CSS file, separate from the originals. I have a 1-liner PHP include in functions.php to pull in my custom functions. And then my custom functions file enqueues the custom CSS file. I’m sure that sounds super geeky. :-) The great thing about that is that if I inadvertently blast the original functions.php with my theme update, I just put back my one-line include and I’m back in business.

    I now have so many favorite functions that I break many of them out into my own plugin. This makes those things completely immune from a theme update. But that’s even geekier than option 2. ;)

    Cheers, Dave


    Dave Chu · Custom WordPress Developer – likes collaborating with Designers

    #102770

    Andrea Rennick
    Keymaster
    Post count: 1437

    The child themes do not get upgrade notices .You are not expected to update them if we push put a new version.


    **forum signature**
    If you need technical support for your theme please file a ticket.

    The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.

    Twitterholic

    #102912

    Chrys
    Member
    Post count: 38

    Hi David and Andrea,

    Think you both for your answers.

    @andrea, if I understand there is not so often new updates for the child theme we find here, am I correct? The most important is to update the genesis framework, is it?

    @david, I understand your procedure. I think I could deal for the moment with code comparing because I don’t make huge changes for now. But I have a question about that. Is there a tool, an app, a program of some sorts that allow to compare two files and point out the difference?
    Actually I have a security plugin in wordpress that does that on php files so that it tells me if a hacker have succeed to go in my files and has made a change. I find that it’s a great tool to compare files but I don’t know if such a thing exists for css files for example..
    If someone have heard of some tool I’d like a name ;-)

    Kind regards

    Chrys

    #102932

    David Chu
    Participant
    Post count: 1428

    Hi Chrys,
    I agree, code compares can be pretty quick. Any file compare program will work for PHP or CSS, as they’re just text files. As for tools, the one I use is a creaky old Windows program, WinMerge, it’s super. Another approach would be Notepad++ with its Compare plugin. There are loads of file compare programs.

    If you’re a Mac person, you got me, although this looks like it could help.

    Cheers, Dave

    PS: Studiopress theme updates don’t come out too frequently. There is still a backlog of ones that haven’t yet been updated for HTML5, for instance. Genesis framework is even less frequent, because it’s a bigger deal, but yes, I’d say if that changes, it’s probably pretty important and worthwhile.


    Dave Chu · Custom WordPress Developer – likes collaborating with Designers

    #108453

    DanielSchoenmaker
    Member
    Post count: 8

    I was wondering the same. David Chu, could you put up a how-to for your method? Sounds interesting!

    #108460

    David Chu
    Participant
    Post count: 1428

    Hi Daniel,
    Thanks for asking, I will think about it. I probably won’t do the part that shows the exact compare program I use, because it’s an old program, and I think few people use it.

    If you make just a few changes in your CSS or functions.php file, I would suggest just putting code comments on them, and then back them up, storing them somewhere safe. Then when you do a theme update and oh no, you’ve knocked out your cool changes, just look at your backups and copy your changes back in.

    It’s only if you make a LOT of changes that I would advise using fancy code-compare software.

    I like to get the updates of themes, but as mentioned above, it’s usually not absolutely necessary.

    Dave


    Dave Chu · Custom WordPress Developer – likes collaborating with Designers

    #108461

    DanielSchoenmaker
    Member
    Post count: 8

    I actually meant the part where you started sounding super geeky. ;-) Would like to make modifications and just add a single line after updating the theme.

    #108524

    David Chu
    Participant
    Post count: 1428

    Got it! Here’s a taste that gives a simple illustration:

    Let’s say I want to have a separate custom stylesheet. I create a file in the same folder as style.css and I call it the incredibly original name of custom.css, and put my fancy CSS in it. :-)

    Then I make a new file in the same folder called custom-functions.php. I put in this code in it to activate the new CSS file:
    [php]
    <?php

    /** load custom stylesheet */
    add_action( ‘wp_enqueue_scripts’, ‘dc_load_custom_stylesheet’, 10 );
    function dc_load_custom_stylesheet() {
    wp_enqueue_style( ‘custom-stylesheet’, CHILD_URL . ‘/custom.css’, array(), PARENT_THEME_VERSION );
    }
    [/php]

    Last important step: I add this line somewhere in functions.php to activate the new function file and the new CSS:

    [php]
    /*** daniel’s meaningful comment describing the next line ****/
    require_once( ‘custom-functions.php’ );
    [/php]

    Caution: have FTP ready just in case you make a typo and bring your site down. Changes to function files can do that!

    Cheers, Dave


    Dave Chu · Custom WordPress Developer – likes collaborating with Designers

    • This reply was modified 6 months, 2 weeks ago by  David Chu.
    • This reply was modified 6 months, 2 weeks ago by  David Chu.
    #115974

    gyoder
    Participant
    Post count: 3

    I’m using Genesis Extender by CobaltApps and noticed that my changes to the CSS are in genesis-extender-custom.css file. There are also other “custom” files within that same folder so I’m wonder if by updating my Child theme my changes should in fact be preserved since it doesn’t “appear” to be changing any child theme files directly ?

    #115976

    Kellylise
    Participant
    Post count: 511

    I have Cobalt Apps’ Genesis Extender and Dynamik-Gen childtheme.

    I’m wonder if by updating my Child theme my changes should in fact be preserved since it doesn’t “appear” to be changing any child theme files directly ?

    Yes, that is one of the key features of Cobalt Apps Extender plugin | Dynamik childtheme.

    Dynamik takes this one step further:

    http://dynamikdocs.cobaltapps.com/article/104-protect-specific-folders-from-dynamik-auto-updates

    #115979

    gyoder
    Participant
    Post count: 3

    I assume best practices would be to Export my Genesis Extender Settings, Delete the Child Theme, install the new version of the Child Theme, install the Genesis Extender in the Child Theme and Import the previously saved Genesis Extender Settings file ?

    #115980

    Kellylise
    Participant
    Post count: 511

    Suggest you open a thread on the Extender/Dynamik Forum.

    My (non-professional) approach: Because Extender is a plugin, it does not need to be re-installed. Perhaps deactivated (temporarily) while you update the Genesis childtheme.

    You’re right @ exporting settings – backup is always a best practice.

    Regarding the Genesis childtheme, if it has no customization (because you used Extender), follow manual childtheme updating best practices.

    #115983

    David Chu
    Participant
    Post count: 1428

    Hi Folks,
    Just a quick other option for people trying to do this. Katrina’s method is even simpler than the way I do it.

    http://77webstudio.com/safely-customize-genesis-child-theme/

    Of course, there’s always the option of hiring competent help if you’re unsure, but of course nobody does that. :)


    Dave Chu · Custom WordPress Developer – likes collaborating with Designers

Viewing 14 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic.