最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to keep my custom theme changes after updating genesis child theme

programmeradmin4浏览0评论

I am using a Genesis child theme that I would like to make some custom changes to it, but would like to be able to update it when a new version comes out without loosing my edits. I am familiar with the parent-child practice, but since my theme is already a child of genesis what is the best way to approach that?

First, I tried to make a parent-child-child theme, but not only some of the markup is different, but I also lost all my widgets sections from the parent-child theme.
-created a new directory with a style.css and have this code:

/*
Theme Name: parent-child-child
Template: genesis
*/
@import url("../parent-child/style.css");)


Next, I copied all files(functions.php, Template files, other...I only kept the style.css from my first try) from my parent-child theme to my parent-child-child theme and it worked, but I am worried that the code from functions.php is going to be loaded twice and therefor slow down my website or even break it down at some point.

What would be the right way of dealing with this problem?
Thanks,
Radi

I am using a Genesis child theme that I would like to make some custom changes to it, but would like to be able to update it when a new version comes out without loosing my edits. I am familiar with the parent-child practice, but since my theme is already a child of genesis what is the best way to approach that?

First, I tried to make a parent-child-child theme, but not only some of the markup is different, but I also lost all my widgets sections from the parent-child theme.
-created a new directory with a style.css and have this code:

/*
Theme Name: parent-child-child
Template: genesis
*/
@import url("../parent-child/style.css");)


Next, I copied all files(functions.php, Template files, other...I only kept the style.css from my first try) from my parent-child theme to my parent-child-child theme and it worked, but I am worried that the code from functions.php is going to be loaded twice and therefor slow down my website or even break it down at some point.

What would be the right way of dealing with this problem?
Thanks,
Radi

Share Improve this question asked Sep 8, 2012 at 6:08 RadiRadi 2495 silver badges11 bronze badges
Add a comment  | 

3 Answers 3

Reset to default 2

Genesis (and others like it) has always had a problem with a lack of consensus on how to cope with updates to its child themes. The simple conventional answer is that you should seldom or never update them, because it may be a very time-intensive process to avoid breaking things. StudioPress does not do auto-updates for child themes anymore, so you have to go out of your way to follow the updates, get them, and merge the changes into your existing child theme. If you do this through a git repo you can automate and manage it rather simply and well. But even if you are doing that, why make things any more difficult than necessary?

My advice:

  • DON'T try to make a grandchild theme. Nobody recommends this.
  • DON'T make m/any changes to a Genesis child theme. The fewer changes the better, preferably zero. Then you can run updates to it without worry.

  • DO all your customizations in additional CSS outside the child theme. Add it to the Customizer if you like, just back it up carefully or lock out people who you don't want touching it.

  • DO further customizations in original plugins or snippets.
  • DO use Genesis plugins like Simple Hooks and Simple Edits.

If you are switching between parent/child themes your widget and customizer settings will not carry over between them. You need to use import/export plugins for that.

If you are making your own Genesis child:

  • DON'T use @import for your CSS.
  • DO use the enqueue method to include styles.

发布评论

评论列表(0)

  1. 暂无评论