WordPress Parent and Child Themes

WordPress Parent and Child Themes

The parent theme plays an important role like it acts as a base for the child.

Main Functions of parents and child themes?
• Parent theme: Parents theme contains the code that creates the function & features of your wordpress site.
• Child theme: Child theme contains the styles and image that form the base for your site’s design.

Features:
• This parent/child framework protects the theme
• In the earlier phase, if you customized a theme and now you want went to upgrade to a newer version you would need to get all your changes in the customized theme & then recreate them in the newer version, otherwise you would lose all your changes when you upgrade.
• With the parent/child framework all customizations are stored in the child theme
• Your customizations are safe from future upgrades because you have only upgrade the parent theme, which you never goes to edit, while the customizations are protected in your child theme which you don’t upgrade.

How to Use Parent and Child Themes?
When you install a theme that uses a parent or child framework you upload both parent and child theme in same directory to /wp-content/themes/ but only activate the Child theme .
For example:
• When you install Thinkcode theme you upload the Thinkcode and Thinkcode-child folder to /wp-content/themes and then only activate the ‘Thinkcode-child’ theme.

Modifying Files from the Parent Theme Folder to Child Theme Folder
• You should never edit files in Parent theme, only you can download a copy of the file which you want to modify onto your computer, make the necessary changes, and then upload it into your child theme folder.
• Any files that are uploaded to the child theme automatically override in the parent theme as anything in the child takes first priority over the parent.
• This technique can be used for folders within the parent theme, but you must re-create the as it is folder structure in your child theme that exists in the parent theme folder.

Advantages and Disadvantages of Using WordPress Child Theme

Advantages and Disadvantages of Using WordPress Child Theme

WordPress Child Theme means?

A child theme is simply a theme that inherits the functionality and looks of another theme or the parent themes.

A WordPress child theme means a WordPress theme that inherits its functionality from another WordPress theme or the parent theme. Child themes are often used when you want to customize an existing WordPress theme without losing the ability to upgrade that theme.

Designers and developers use child themes to speed up their development.

Advantages of Using a Child Theme

• If we create a child theme we will not need to create a new theme from scratch. Which help to increase the speed of development and reduction in time to complete task.
• You can avoid irreversibly damaging your site by using a WordPress child theme.
• A child theme automatically inherits the parent theme’s features, styles, files and templates.
• There are a lot of free theme frameworks available which give you a wide range of functionality will not need too much customization in our child themes.
• A child theme built on a theme framework allows a great deal of flexibility without writing many lines code.
• You forget to code for something, then there is always the parent theme’s functionality available as the fallback option.
• You will get benefit from updates to the parent theme without having to recode all your child themes.

Disadvantages of Using a Child Theme

• Disadvantage of using child themes is the time we need to invest to learn about the parent theme.
• You need to learn hooks and other functions that are used by parent themes or framework.