Frameworks? Parent, child, and grandchild themes?

(Thierry Muller) #1

Hey everyone, I am curious to know what you guys think about this topic.

This apply to other themes like Genesis or Beans Theme Framework. Third party devs child themes are modified by end users and therefore can’t receive updates as it would overwrite the end users modifications.

@justintadlock solution is to have the “framework” as part of the parent theme, but I have an issue with as it becomes super maintenance heavy when a third party dev have like 20 themes and and update is made to the framework.

Looking forward to hear your opinions or even better, a real solid solution :slightly_smiling:

(Justin Tadlock) #2

From a developer standpoint, the maintenance doesn’t change one bit. What you’re updating is the only thing that changes. If you’re using version control (like any good developer would do), it’s as simple as clicking a button or typing a command to update. Or, it’s as simple as doing nothing if you have an auto-update script running.

Anyway, it’s no more or less “maintenance heavy” than updating a parent theme from the developer perspective.

However, it is less of a burden on end users who’ve made mods to their child theme but want to continue getting the best of the new stuff from the parent theme (note that end users shouldn’t even know that they’re using a “framework”).

Hybrid Core (my framework) isn’t one of the oldest and most-used frameworks for no reason. I’ve taken the actual framework approach for many years and rarely have to worry about common user issues related to this subject.

And, just to be clear, this is not my solution. Carrington and WP Framework were doing it before I was doing it. And, loads of other developers were utilizing frameworks before then.

Additionally, the “solution” doesn’t necessarily have to follow the “framework within the parent theme folder” path. It could just as easily be a plugin. I don’t personally do it that way because I think that puts more burden on the end user.

(Ulrich) #3

Here are a few thoughts and possible solutions.

Managing template file versions

Torsten Landsiedel presented an idea at WordCamp Cologne 2015 how we could track changes to the template files in a child theme.
The slides in English.

Building a theme with Grunt

Compass was a theme builder using Grunt. It has now been discontinued. I think the reason that it did not become popular was that it complex.

Using submodules

When I worked at CyberChimps we had one submodule with all of the main code and then each theme had it own templates and styles. Submodules are difficult to use and update.

Theme builders

I think theme builders like are great. Recently there has been a component version also released which allows you to generate differnt type of themes. I find that this is an interesting way of building themes. You select the components that you need and you generate the theme update. Something like modernizr.

Single grunt configuration across themes

Cedaro use one grunt configuration that they use across multiple themes. I did something similar for a theme and a child theme for main site I am working on.

Modular PHP

By breaking the theme down into small pieces you can modularize it. By creating small libraries you could easily include them into the parent theme using Composer. It makes also very easy to update these libraries.

Modular CSS

For the CSS you could create separate files for the different sections like for the gallery. In the build configuration you can then define which styles you need for the theme,

Child themes

I find that child theme will only work if you don’t expect to push updates out or you know the user will not make changes to the child theme. You could still release child themes that site developers could use as a base to reduce the amount of work.

In the end it comes down who your primary user is and what they are gong to do with your product.