Deprecated: Assigning the return value of new by reference is deprecated in /nfs/c03/h06/mnt/47169/domains/ on line 186

Deprecated: Assigning the return value of new by reference is deprecated in /nfs/c03/h06/mnt/47169/domains/ on line 108

Deprecated: Assigning the return value of new by reference is deprecated in /nfs/c03/h06/mnt/47169/domains/ on line 171

Deprecated: Assigning the return value of new by reference is deprecated in /nfs/c03/h06/mnt/47169/domains/ on line 484

Deprecated: Assigning the return value of new by reference is deprecated in /nfs/c03/h06/mnt/47169/domains/ on line 581
How parent/child themes should work « Community

Welcome, guest!

Feel free to read the blog, browse for themes, or join the club.

The community forums are currently being phased out. At the end of February or early March 2012, you will no longer be able to post here. This is because the entire site is being restructured. Please use the main forums for discussions.

How parent/child themes should work

  1. I'll try to explain everything here, but I know it could be confusing.

    When developing a theme framework, there are a couple of ways to create it:

    1. Create a base theme and build child themes off of it, which are packaged separately (what we're currently doing).
    2. Create a base theme and build themes with it packaged together, essentially making the new theme a framework.

    We'll be talking about the Hybrid theme here, but this can be extended to any theme framework.

    Why theme frameworks are created

    The allure of frameworks for us developers is mainly covered by a few ideas:

    1. Keep users up to date w/o sacrificing the integrity of the code.
    2. Speed up development time by not having to recode the same things over and over.
    3. Helps with support if everyone is using the same thing.

    I believe the first and third items apply to users in a great way.

    What happens when the child theme is updated using method #1?

    This is probably the ultimate question that some people have on their minds. In fact, the-elder brought up this question recently (you can see my full thoughts on his questions there):

    When I code a child theme, I try to code it in such a way that you wouldn't need to upgrade your copy if I ever update the one on the site. You don't have to upgrade your child theme. That's kind of the whole point, right?

    But, there's always the possibility that something might need to be changed, which essentially breaks down the entire parent/child theme idea.

    In comes method #2

    This is how it's done with Carrington (for those of you that've used that theme).

    With method #2, Hybrid would behave as the logic behind the theme, not the parent theme itself. We'll use Hybrid News as an example here.

    So, if Hybrid is the logic, then Hybrid News is the theme (the style, the additional functionality, etc.). This would allow me to package Hybrid News as an indvidual theme. The idea would be:

    • Hybrid is packaged inside of Hybrid News.
    • When Hybrid gets updated, Hybrid News gets updated.
    • Users build child themes based on Hybrid News instead of changing the code within the theme.

    I hope all of that makes sense. Basically, every time I updated Hybrid, I'd just transfer the new code into each child theme.

    Problems with method #2:

    • Keeping track of all the changes between themes.
    • Possibly more confusion.
    • I'm just confused about how I would do the versioning system.

    The discussion is open

    If none of this made any sense to you, that's okay. I know most of you are just interested in having a theme that works.

    These are just some ideas I've been thinking about for a while, which I think are worth discussing. The main goal is to keep you all updated with the latest code without screwing up your sites when something is upgraded.

  2. Hi Justin- Hybrid News is so awesome. Thank you for all your hard work!

    It's been a little confusing joining the members area to get information about how to make a customized Child Theme for Hybrid News (I found one for Hybrid).

    I need to know: how to make a childtheme of a childtheme? I don't know how to make Hybrid "the logic behind" Hybrid News. Perhaps you could do a post specifically about this? I cannot move forward with a new client until I get the childtheme up and running.

    After I create a childtheme with the right import code for the right template name, I would like to be able to change the header image. It seems as though you created a nifty widget, but I can't find it in the widgets area.

    In the meantime, I will keep punting here:

    Hope you had a nice break, wherever you went.


You must log in to post.

Topic Info

Topic Tags: