In this tutorial we see the differences between the types of WordPress themes: Themes, child themes and parent themes.
Types of WordPress themes
There seems to be a bit of confusion between the different types of themes (themes, templates) that exist in WordPress, and it is normal. Usually just the word “theme” is used without specifying.
So, let’s see the differences between:
- Parent themes
- Child themes
Although they are all very similar, there are certain things to keep in mind when choosing one.
As you can see, we start with the easiest. A theme is a set of files that give appearance to our WordPress. At least it must have a file called style.css in which there is the information of the same (name, author, license, etc.) and CSS styles.
In summary: Any theme that does not depend on another theme can be considered a “normal” theme. The only ones that would not fall into this classification, would be the “child themes”, since they depend on another. Something very important that you should always keep in mind is that you should never modify a theme. The files that make up a theme (.php, .css, .js, etc) should be untouchable, because every time a theme is updated, all the changes we have made are lost.
The correct way to modify a theme is to create a child theme, as we will see below. Because if we modify a theme directly, we are giving up all future updates.
💻 Parent themes
So, we have already seen that the themes are “look at me but don’t touch me”. Let’s see now the concept of “parent themes“, which is even easier, take note:
A parent theme is any theme to which a child theme has been made. Yes, I know it’s obvious, but that’s how it is. The moment you create a child theme of a theme, it is already a parent theme. It’s like people. A person becomes a parent the moment he/she has a child. It is still a person (theme), but it is also a parent.
We don’t need to change anything in the theme itself, just by creating a child theme we already have it. So rather than depending on the theme, it depends on someone “making him a child”.
In principle by default all themes are prepared to have child themes, but some have certain functions that make them more prepared.
Child themes 🖱
Let’s move on to child themes, the child templates. Call them what you want, but it’s the same thing. What are they? A child theme is a theme that by default inherits all the functionality and styles of another theme (its parent). Apart from inheriting the styles and functions of its parent theme, it can add its own, which have priority. So, if the child theme does not add or change anything, it would be a clone of the parent theme, all identical. But the moment you add a style or function, it will overwrite that of its parent theme.
- If we have a theme with blue links, and we want them green, we create a child theme (converting it to parent), and add that line in the style.css file of the child theme.
- If we have a theme without a footer and we want to add it, we create a child theme (converting it to parent), create our own version of the footer.php file and add it to the child theme.
Thus, both the styles and functions created in the child theme will have priority and override those of the parent theme. And the functions that are not mentioned, will remain those of the parent. This is the best way to modify the behavior of a theme, because now our changes will always remain, even if we update the parent theme. Of course, note that what we update is the parent theme, not the child, because we created the child, we are the developers! So we are the ones who update it day by day, so to speak, creating the styles and functions that we want to modify.
So this is the idea: The moment we create a child theme, it becomes independent, without depending on anyone else than the one who created it. Moral: If you create a child: Take care of it.
So, download a wordpress theme, create a child theme and create content with interesting posts. And of course, create links to help your website rank higher in Google.
Important: A child theme cannot have child themes. You cannot create the child theme of a child theme, there is no such thing as a “grandchild” theme. Only one level is allowed, so to speak. So a child theme cannot be a parent theme and a parent theme cannot be a child theme.