Child Theme Basics
A WordPress theme is a collection of template files which lets you change the user interface, design, look, and feel of the site. A WordPress theme can either just have some bare minimum design changes implemented or might even have some advanced logic showing the most recent post differently than the others or showing the posts from a particular category in a different section on the home page etc. WordPress themes can range from a simple set of files to a complete complex framework so that other themes can be built on top of that.
As with all industries, WordPress theming has it’s fair share of trends, flowing in and out of popularity as the WordPress product and community evolve. Through these trends, needs for supplementary resources evolve, where users aim to enhance trends via additional products or services. A trend that has been growing in popularity in recent years is that of “Theme Frameworks” or “Advanced Parent Themes”. These themes, while bundling in large amounts of valuable code, can become confusing to modify and upgrade for the end user. This, following the flow of trends, grew the awareness and need for the use of child themes.
Child theming has been around in WordPress for a considerable amount of time, allowing users to create a smaller theme that piggybacks off of a larger theme, with it’s own CSS and customised PHP functions.
A child theme, as defined by the WordPress Codex, is a theme that “inherits the functionality and styling of another theme, called the parent theme.” Child themes are recommended to modify existing themes while still maintaining their design and code.
These themes provide a way for designers or developers to create new designs that inherit the functionality of a parent theme.
Each of those child themes inherit the features of Storefront core, including compatibility with each of our Storefront Extensions. But they adapt different styles and appearances, because child themes can make a parent theme look completely different.
Child themes also enable folks to customize a parent theme themselves without touching any core files, a practice that safeguards those customization when performing updates to the parent theme. However, child themes are becoming more and more popular at theme shops for the reasons outlined above.
The one potential issue with this process is that you can only activate one child theme at a time. That means if you’re using one of our Storefront child themes, you cannot create a “grandchild theme” to further customize it. But don’t worry — there’s several smart ways to modify child themes without worrying about losing your changes during updates.
There are a few reasons why you would want to use a child theme:
- ?If you modify a theme directly and it is updated, then your modifications may be lost. By using a child theme you will ensure that your modifications are preserved.
- ?Using a child theme can speed up development time.
- ?Using a child theme is a great way to to learn about WordPress theme development.
There are a number of reasons that WordPress developers are starting to use child themes. They give you the opportunity to customize a unique layout on top of another existing theme. This is perfect for beginners who want to play around with building their own themes.
Advantages & Disadvantages of Using Child Themes
Using a child theme has many advantages some of which are as follows:
- ?If we create a child theme we will not need to create a new theme from scratch which will have faster development time.
- ?There are a lot of free and commercial theme frameworks available which give us a wide range of functionality will not need too much customization in our child themes.
- ?If we use child themes as opposed to directly modifying the parent theme to suit our needs, we will easily be able to upgrade to a newer version of the parent theme without losing any of our customization.
- ?A lot of times parent themes not only provide the design but also include widgets and plugins which can be directly used if we create a child theme of that parent theme.
- ?If it’s a popular parent theme you are using, either free or commercial, it’s more likely to have fewer bugs and be more stable as it has been used and tested on multiple sites.
Some of the disadvantages of child themes are:
- ?When we make child themes WordPress has to look into two places to find template files, this has some performance cost and hence using child themes might have some performance impacts on you site. Though in reality, these are very minimal.
- ?A lot of the theme frameworks are very extensive and provide a lot of features which might not be useful to you. This makes frameworks complex and it would increase the time taken to learn and master the framework.
WordPress themes provide a lot of flexibility when it comes to designing your website or store. You can definitely create a unique look and feel using a theme and extensions. But you might not be able to create something that perfectly fits the niche that your store occupies, especially if your design chops aren’t your best asset, or you don’t have hundreds of dollars to spend on a premium theme.
That’s where child themes come in. Child themes provide a turnkey solution that allow you to very quickly set up a website with an aesthetic that matches your industry. They’re often based on existing free or “sandbox” themes, too, which means you’ll pay only for the child theme that suits you best.
WordPress Theme Frameworks
There are a lot of free as well as commercial theme frameworks for WordPress than can be used as a parent theme. Some of them are generic and add a wide variety of functionality. There are also theme frameworks available for specific kinds of needs like creating a real estate site or creating a product catalog site etc.
Some of the free popular theme frameworks are:
- ?Twenty Eleven - Though this is a complete theme, it is a very good starting point to create a child theme as it has all the functionalities to create a good web site. The style of this theme can be easily customized. This is a free theme and comes with the default WordPress installation. So it’s a great framework to look at if you want to create a simple and cool web site.
- ?Thematic - This is a very popular theme framework for WordPress. This is a free theme. This also has many child themes made on top of it which are also freely available. This theme framework has a lot of hooks which the child theme can use to customize. It also has multiple styles like 2-column and 3-column which can be used. It also has good documentation available which would make it easier to get started with this framework.
- ?WhiteBoard - This is also a very good and useful framework. This comes with bare minimum functionality and good structure which can be customized for your needs. It’s a very useful framework.
Child themes are not as difficult as they may appear. The benefits of working off a parent theme means you don’t need to write all the HTML/CSS from scratch. A child theme will automatically use any template files you include, such as sidebar.php or footer.php. But if they are missing, then your child theme will pull the same files from its parent.
This functionality offers an enormous amount of freedom to customize already existing templates. It’s also great for touching up areas around your website for special events, such as adding design patterns for Christmas or New Years.
WordPress is a great platform to build blogs and sites. It also provides the infrastructure to create plugin frameworks or theme frameworks on top of it. The theme frameworks built on top of WordPress can help one develop a stable, good quality theme in quick time and will also let the uniqueness of your site remain intact. This helps in faster development time and lower costs. So have fun creating your WordPress child theme.