I’m building a theme to be used as an example for other websites for the company I’m working. In another project we used the Hybrid Parent Theme and was really easy to build, but REALLY hard to maintain the website.
I prefer the Starter Theme approach, which another developer copy the theme and create from it. The Parent->Child gives too much freedom for the developer mess the code. For example I didn’t know if something was being called on the child or on the parent.
I would like to hear from you:
- When a Parent theme is better?
- When a Starter Theme is better?
- What are the pros and cons for each of them?
Thanks.
I totally agree with Rarst. I just want to add some small things.
Note: I differentiate parent theme and framework. In my answer, I consider parent theme like TwentyEleven where it’s mainly created for a specific website and less hooks than a framework.
Starter theme:
Pros
<div>
, custom CSS class for an specific element. It’s a good way to create a very minimal theme for personal blog where you don’t need many things that parent theme provides (or at least if you use parent theme/framework, you have to hook to remove them). You can also echo special part of HTML like aniframe
that refers to another website or just a ‘Hello text’ much more easier than using a parent theme.Cons
Parent theme:
Pros
style.css
like changing color, font size, etc.Cons
Framework:
Pros
Cons
genesis_meta()
(not needed as we havewp_head
).require_if_theme_supports
function)Last thing: all starter theme & parent theme & framework can be used for any site if it’s easy for you to customize to achieve the final result. There’s not one solution for all situations. We have to pick which one can help us most, maybe this time the starter theme is good, but in another time – a framework. By the way, working with all of them can give us much experience that help us in many situations, not only when creating themes!
Theme workflow balance is combination of several factors:
Each of these can be important and each of these can be unimportant.
Parent theme model satisfies all of these reasonably well, but not very well. You get clear separation of shared and individual code, as well as straightforward upstream updates (if using third party parent theme). It start to come apart when any requirements gets larger than usual – a lot of individual code or a lot of shared code that can’t be easily mixed in third party parent theme.
Starter theme on other hand is very specialized model. It favors individual site, but disfavors upstream changes and shared code. As soon as you make starter theme your own – all burden of moving code in and out of it is on you.
The newer trend is separating frameworks into plugin-like component rather than them running parent theme completely. If you are acquainted with Hybrid as parent theme look into Hybrid Core. This approach is essentially improvement on top of parent/child with upstream updates made easier by being limited to framework and not whole theme.
In a nutshell (gets a little subjective here):
The main reason to use parent themes is to allow for easier updates – if you just take a theme and edit it directly, then if the original theme gets updated, then you have to reapply any changes you made (or merge the changes in the original back into your modified theme).