There's been a lot of recent buzz regarding theme frameworks within the WordPress community. You may wonder how child themes fit with that notion, and the answer is, of course, perfectly well. Most so-called theme frameworks are semi-blank themes that are designed for you to modify, using either child themes or similar concepts. Some want you to put custom code in folders within the theme, for example, so it pretty much depends on how the theme designer envisions the usage of the creation.
However, that doesn't mean that you're limited to doing it the way the designer intended. Any theme is really a theme framework, and any theme can be used as the mother template theme for a child theme. In other words, just because a particular theme framework author thinks that you should do things in a particular way, that doesn't mean you have to. You can always just use the theme as the template theme, and then create your own child theme.
Some of the functionality in these themes designed to be used as frameworks for your own creations rely on action hooks. This is basically a way for the theme to pass implementation and data to
Another of the things people running multiple sites need to tackle is the maintenance of plugins. Granted, this is a lot easier these days, with upgrade functionality from within the WordPress admin interface, but some of the things you use plugins for can in fact be done just as well from within your themes. And while you can have those cool things in your theme's template files, whether it is a mother or child theme, it just isn't all that convenient. Besides, the whole idea with themes in the first place is to separate design from code, so filling the template files with more PHP snippets than usual kind of works against that purpose.
This is where functions.php may be an acceptable middle ground. After all, it is a template file outside of the design part of the theme, existing purely to add extra functionality through PHP coding. So maybe it is a better idea to write general functions in the functions.php file of the main mother template theme rather than maintaining plugins that do the same thing across all sites?
the theme using functions.php. Then, your child theme (or pseudo-functions file within the theme framework if that's the solution of choice) can do things with these action hooks, including removing them should they not be wanted. We'll get to action hooks in the next chapter.
So any theme is a theme framework, and the themes that try to pass themselves off as theme frameworks are basically just creations more suited for being used as the basis for new designs. That is worth keeping in mind, I think.
Was this article helpful?