As a beginning WordPress designer/developer, you are going to be inundated with terms, acronyms, code samples, and all sorts of things that you will likely have a tough time trying to make sense of. One of the objectives here at WPTeach is to help clear up the mud a little, or, at the very least, minimize the effect of trying to drink from the fire hose of WordPress Knowledge. We want to get you building the projects you envision.
While there are lots of things to try and learn, this post is going to focus on something called a framework. In the land of WordPress, a framework can best be described as a solidly coded theme that is used as a base for your project. Now, unless you’re already fluent in WordPress speak, that may not have been a helpful definition, so let’s break it down even further for you.
A framework is a piece of software that serves as a foundation upon which you to build a custom theme for your WordPress powered website. Most frameworks are intended to do the heavy lifting, allowing the user to focus on the look and feel of the website instead of wrangling actual WordPress code.
Child Themes: What Do They Mean to You?
Every framework is build on the concept that your custom theme should reside inside something known as a child theme. A child theme is simply a new theme that references the parent theme (main framework), calling upon it for the core functionality of the website. A child theme can have as little as a style.css file in it or as many files as a regular theme; that decision belongs to the developer. The idea here is that the files in the parent theme remain untouched while the child theme handles how the site modifications are handled. By not editing the parent theme files, you are less likely to suffer any issues (like the site breaking, leaving your carefully crafted design looking as if it was put together by a toddler doing keyboard bashing), if the parent theme is updated by the original author.
How Do I Make a Child Theme?
In order to make a child theme, simply navigate to wp-content/themes and create a folder named whatever you would like to call your new theme. Make sure you have previously uploaded the framework you plan to build the child theme on or nothing will work. Inside the child theme folder, add a new file and call it style.css. (Note: WordPress must have a style.css file to work, so don’t name it something different).
Using a text editor, add the following to the top of the page
Lets go through it line by line:
/* indicates the beginning of a CSS comment
Theme Name: simply add whatever name you want to call your theme.
Theme URL: The URL where the theme can be found
Description: Whatever description you’d like to put in here is fine
Author: Your name
Author URI: Your website address
Version: The version number of the theme
Template: The name of the parent theme
*/ the closing tag for the CSS comment
Now you are ready to add your own look and feel to your WordPress site. You can also add functionality through hooks and filters, but we’ll cover those in subsequent articles. All you really need to add here is an images folder and a functions.php file. The images folder should be self explanatory and the functions.php file is a file that allows you to control the behavior of WordPress or how things are displayed. For example the functions.php file can register sidebar widgets and how they will be displayed.
Some examples of frameworks currently available:
Have a favorite framework? Tell us which one and why you like it in the comments below.