Wordpress Child Theme Fundamentals

source_phpThis lesson will cover the very fundamentals of what a Wordpress child theme is and how the basic structure looks like. In a future lesson I will go into how to create an actual child theme and the coding process.

So what is a child theme?

To begin we must first talk about what a regular theme in Wordpress is. A theme is any design that you create and place in the Wordpress theme folder. Of course there is a specific structure to have and a specific style sheet code that must be in place in order for your theme to be recognized by Wordpress.

With that in mind, a Wordpress theme generally contains a core set of files and a style sheet that provides the rules of the design. There are times when you search online for themes and find one that you like. Then you proceed to modify it to your needs. But what if there was a better way to modify a theme you liked without touching the core files?

The child theme

Here is where child themes come into a play. A child theme is a theme that inherits everything from your main theme, but only contains a style sheet and a functions file. This allows you to edit your favorite theme without touching the core files. To better illustrate this we have an example pictured.

folders

You core theme or favorite theme or even your blank theme sits in your Wordpress theme folder. You then create a child theme folder with your two files and start designing. This allows you to create multiple child themes relying on one core theme as the framework. You don’t have to touch your core files ever again.

This concept may sound abstract but once your start building your own child theme, this concept may turn into an epiphany.

Core files in a child theme:

  • style.css (your style sheet)
  • functions.php (extra code to help modify your theme)

A traditional them will contain ten or more files that make up the core, the child theme borrows those files from another folder but relies only on the style sheet and the functions file for the main design. If you have read tutorials on how to create a theme, you should realize what the benefits are of having a child theme. In a future lesson I’ll go into the details on how to create your first child theme.

This entry was posted in Themes and tagged , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Spam Protection by WP-SpamFree