Community Forums › Forums › Archived Forums › Design Tips and Tricks › child themes and updates
- This topic has 13 replies, 6 voices, and was last updated 9 years, 9 months ago by David Chu.
-
AuthorPosts
-
April 28, 2014 at 7:41 am #102712ChrysMember
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
April 28, 2014 at 9:01 am #102725David ChuParticipantChrys,
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
April 28, 2014 at 12:19 pm #102770Andrea RennickMemberThe 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.
April 29, 2014 at 9:33 am #102912ChrysMemberHi 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
April 29, 2014 at 10:09 am #102932David ChuParticipantHi 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
June 7, 2014 at 11:48 am #108453DanielSchoenmakerMemberI was wondering the same. David Chu, could you put up a how-to for your method? Sounds interesting!
June 7, 2014 at 12:54 pm #108460David ChuParticipantHi 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
June 7, 2014 at 1:02 pm #108461DanielSchoenmakerMemberI 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.
June 8, 2014 at 9:36 am #108524David ChuParticipantGot 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 /** 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 ); }
Last important step: I add this line somewhere in functions.php to activate the new function file and the new CSS:
/*** daniel's meaningful comment describing the next line ****/ require_once( 'custom-functions.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
July 27, 2014 at 7:38 am #115974gyoderMemberI'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 ?
July 27, 2014 at 8:03 am #115976DTHkellyMemberI 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-updatesJuly 27, 2014 at 8:51 am #115979gyoderMemberI 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 ?
July 27, 2014 at 9:05 am #115980DTHkellyMemberSuggest 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.
July 27, 2014 at 9:33 am #115983David ChuParticipantHi 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
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.