Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress PHP for WordPress Introduction to PHP for WordPress PHP Files

Rebecca Jensen
Rebecca Jensen
11,580 Points

Child theme vs. "Custom" theme

Does building a child theme from an existing (and supported) parent theme mean that my site will absorb Wordpress updates better than if I had built a completely new theme from scratch? Or in other words, when a parent theme is updated (either automatically, or when I choose), will my child theme get those updates?

Or does a parent theme not do those things, and I am actually thinking of a "framework" instead of a "parent theme"?

3 Answers

Brian Hayes
Brian Hayes
20,986 Points

A parent theme does not equal "framework" as it is, but it is entirely possible to use it as such.

Not all Parent & Child theme combinations will result in a way that allows your child theme to keep your customizations while the parent theme handles WordPress changes. This comes down to how much the parent theme is doing in the first place, and how on the ball the parent theme developer is.

This is where frameworks tend rain supreme in the Parent > Child architecture. For instance, the Genesis Framework, is a parent theme built for the specific purpose of giving a child theme a great core to work off of, thus taking care of much of the heavy lifting that building your own custom theme may entail. With a set up like this, then you're child theme can handle all the styling and customizations, while the Genesis parent theme keeps the core of your theme architecture nice and tight.

Now, the other approach tends to be using starter themes. These are themes that give you a starting point where a lot of the grunt work has been done for you, and so you can basically get right to styling and templating. Probably the most used example of this would be _s. Others such as JointsWP, give you a starting point on top of a front-end framework. In this case, Foundation 6.

If you happen to employ a full theme, such as a premium theme you buy, then I would suggest your child theme only make minor tweaks. If the parent theme is meant to do everything alone, then most likely the developer is not coding for the sake of child themes, and their updates have a high chance of breaking your child theme, and requiring you to update much more often.

If you want to have someone else worry about WordPress updates and having to stay compatible with those updates, then adopting a framework parent theme, such as Genesis, is your best bet.

If all you're looking for is the speed boost in development, then a starter theme is the way to go. Though you will have to make sure to properly support the theme.

Rebecca Jensen
Rebecca Jensen
11,580 Points

Thank you for your thorough response!

I am building a new website for an orienteering club I'm a member of, and I just can't decide whether to build from scratch, use a starter theme, or use a framework. I think I understand the differences, but I still can't decide.

The support for Genesis looked very appealing, but it seems like working with it is akin to fumbling around in a black box that you can't see into. I don't think I'm experienced enough to do this well.

Using a starter theme seems like a reasonable thing to do, but I'm concerned that I would put a ton of work into editing the theme, only to find that I can't get the functionality I need, which is to push and move content according to the date. So an upcoming date should be on an "upcoming events" page, while a past date should be on a "results" page. There's probably a plug-in to address this, but it seems messy to mix different flavors of code.

So then I begin thinking that I ought to just build it all myself from scratch.

Argh! Can't decide.

Thank you for your description.

Brian Hayes
Brian Hayes
20,986 Points

Rebecca Jensen: Genesis comes with a learning curve, there is no denying that. On the upside there are a lot of helpful snippets on StudioPress and from other blogs, and the hook system is pretty easy to get the hang of, but there are things that are done rather differently than the norm in theme development.

I've been working with Genesis A LOT lately. My last two client projects used Genesis, and my most current project, which is a merging of Genesis with Foundation for Sites 6 has really forced me to dive into the guts of the Genesis code to really see how things are happening.

Now, as a bit of contrast, one of my Genesis projects found me building a pretty basic theme that was very easy to do all in all. My first time working with Genesis I was able to complete the child theme in 2 weeks with WooCommerce set up and everything. This was thanks to how easy Genesis can be to work with.

But here I am now working on a much more complex project that requires me to really dive deep into Genesis to get things done. I think the first case I outlined is much more common.

As for the functionality of the site you're looking for, the rule of thumb you should try to stick to is anything that is adds to the functionality of your website, then it should go in a plugin, but if the functionality is for formatting, templating, and styling, then the theme is the place to go. The idea is, if you switch themes, you don't lose functionality that is core to how your site operates.

When I do custom plugins, I tend to leave out all styling and use my theme to style the elements of the plugin. This is so that I'm not enqueueing more stylesheets and scripts than I have to.

Here's how it works:

  • You buy a theme you like e.g. <a href="http://themeforest.net/item/jupiter-multipurpose-responsive-theme/5177775" target="_blank">The Jupiter theme</a>
  • You then create a Child theme, it is a separate theme that inherits all the styles and functionality from the parent theme (In our example Jupiter), but with the exception that now after inheriting all the styles and functions from the parent theme you can safely overwrite anything.

What do I mean by safely? When a developer updates his theme e.g. to fix a bug, ensure compatibility with the latest version of WordPress etc. Any changes you have made on the parent theme will be overwritten. So, if you had made a child theme all your changes will be there because you are always just overwriting whatever is going on in the parent theme. All your custom CSS and functions will still be there if you use a child theme.

A custom theme is a just theme made from scratch or by using a starter template like http://underscores.me, rather than modifying a theme that someone else built with a child theme.

Rebecca Jensen
Rebecca Jensen
11,580 Points

Thanks for your explanation!

To clarify: If a parent theme is well-supported and is regularly updated, those updates would be passed on to my child theme, correct?

Is it then reasonable to rely on a well-supported parent theme to maintain an updated child theme?

alan ingram
PLUS
alan ingram
Courses Plus Student 3,979 Points

So basically a child theme in development is just making a copy of the original and doing all your work in the copy. Having the parent as a fall back in case you ruin your "child/copy"?

Brian Hayes
Brian Hayes
20,986 Points

No, think of a child theme as an extension of the parent as oppose to building on a copy of it. In development, you would have the to have the parent theme installed, your child theme properly referencing the parent theme in its theme comment header, and the actual active theme would have to be the child theme.

The codex entry on theming isn't bad with its explanation of a child theme at its simplest.

From the entry:

The simplest Theme possible is a child theme which includes only a style.css file, plus any images. This is possible because it is a child of another theme which acts as its parent.

The entry on child themes in the developer handbook is very much worth the read too.