Simple Way To Make A Child Luma Theme In Magento 2

Posted on Posted in Magento 2, Theme

Custom themes if you want to make of luma you can easily do in with the step given below:

Just make the folder in app/design/Company/Theme1/

Inside the Theme1 folder create 3 files theme.xml,registration.php and composer.json

theme.xml

<theme xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:Config/etc/theme.xsd”>
<title>Theme1</title>
<parent>Magento/Luma</parent>
<media>
<preview_image>media/preview.jpg</preview_image>–>
</media>
</theme>

registration.php

<?php
/**
* Copyright © 2019 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::THEME,
‘frontend/Company/Theme1’,
__DIR__
);

composer.json

{
“name”: “magento/theme-frontend-company-theme1”,
“description”: “N/A”,
“require”: {
“php”: “~5.5.0|~5.6.0|~7.0.0”,
“magento/theme-frontend-luma”: “100.0.*”,
“magento/framework”: “100.0.*”
},
“type”: “magento2-theme”,
“version”: “100.0.2”,
“license”: [
“OSL-3.0”,
“AFL-3.0”
],
“autoload”: {
“files”: [
“registration.php”
]
}
}

After that copy the etc,web,i18n and media folder from vendor/magento/theme-frontend-luma and paste in theme1.

Then clear the flush and then go to the database you can find the table “Theme”. In that table you can find your theme name it will be having the value “Null” for the column “parent_id” update it with 2 which is the luma theme id.
Then run the upgrade,compile and deploy commands.
And you have your theme all ready.

Leave a Reply

Your email address will not be published. Required fields are marked *