How to Create Child Theme in Magento 2?

Sometimes, client demand needs changes within the parent theme. However, if the parent theme file is modified directly, we’ll not be able to upgrade it within the future. This is because if we upgrade the parent theme version we will lose all the changes. By making a child theme, we’ll be able to retain our customization and additionally maintain each the original theme and also customized theme in separate folders.

What is a theme?

A design theme is an important part of Magento. The theme is a collection of files like styles, templates, images, Javascript etc which effects on your website look to catch the user’s eyes.

What is a child theme?

The child theme is a theme inherit all the properties from parent theme and can help to customize the present parent theme style as per our website demand.

How to create child theme in Magento 2?

All the following steps are used to create child theme in Magento 2.

Note: In this example,
‘Simbeez’ as vendor name and
‘luma’ as parent theme name.

Step-1: Create child theme folder named as {parent-theme-name}_child

Path:Magento root folder/app/design/frontend/{theme-vendor-name}/

{parent-theme-name}_child

Example:Magento root folder/app/design/frontend/Simbeez/luma_child

Child theme name can be anything whatever you want.But if the name refers parent theme name, it would be easily understandable and developer friendly.

Step-2: Create a file theme.xml inside the child theme to specify the parent theme inherited by the child theme

Note : In above code you can see <media> and <preview_image> tag , both are optional. It is used to display preview how your child theme looks like.If you don’t want to add you can write below code also.

About us

SimBeez IT Solutions LLP provides innovative IT solutions. SimBeez – an IT company that has been serving its clients with satisfactory IT services. We specialize in Web development, Mobile Apps development, Game development, Odoo/OpenERP development, Magento (E-commerce development), Graphics designing, SEO and Digital Marketing.