Magento is open-source. So we can customize Magento themes easily. When we create Magento 2 Child theme which is inherited and we are able to take any items in the parent theme. We can custom Magento 2 looks through Magento 2 child theme base on parent theme, which there is no affect for parent theme upgrade. This tutorial will show you step-by-step “ How to create Magento 2 child theme ?

How to Create Magento 2 Child Theme?

How to Create Magento 2 Child Theme?

1. Create child theme folder which was placed on the same folder of parent theme

(ex: app/design/frontend/Webdux/).We will try to Create a child theme of Caosir theme.

2. Copy files:

LICENSE.txt, LICENSE_AFL.txt and folders: etc/, Magento_Theme/, media/ from parent theme(copy from folder ../Webdux/Caosir/) to the child theme folder. We will have: ../Webdux/caosir_child/etc, /Magento_Theme, media/ (Note: You can copy there other folders if you want to custom from parent theme. Ex: web/ and Wd_Themesettings/)

3. Create the file: theme.xml with content as this:

With:

Webdux/caosir is parent theme name: Webdux/caosir

4. Create the file: registration.php with content as this:

<?php
/**
* Copyright © 2017 WebDux.com. All rights reserved.
*/
 
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::THEME,
'frontend/Webdux/caosir_child',
__DIR__
);
?>

is define path to child theme.

5. Create the file: composer.json with content as this:

6. Then you should run ssh commands to setup the theme in magento2:

php bin/magento setup:upgrade --keep-generated
php bin/magento setup:static-content:deploy

Ref: http://www.venustheme.com/create-child-theme/ ;  http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/themes/theme-create.html

0 Likes
458 Views

You may also like

Leave A Comment

Please enter your name. Please enter an valid email address. Please enter message.