Our brands

Child Theme Configuration

Please create child theme folder in app/design/frontend/company_name/theme_name
ex:
etc/view.xml :-This file is used to specify product image dimensions, thumbnails etc.Magento_Theme :- This directory is used to override existing Magento’s theme files.Magento_Theme/layout/default.xml :- By default, Magento2 assumes that your theme’s logo file should be: /web/media/logo.svg If you want some other file for logo, then you must declare it in default.xml the file.This file is also used to override default theme’s settings.media/preview.png :- The preview of the current theme.web :- This directory contains all the theme’s static data like images, styles, javascript, fonts etc.registration.php :- This file is required to register our theme to Magento2 system.theme.xml :- This is a compulsory file that defines our theme name, its parent and optionally theme’s preview image.

composer.json :- If you plan to distribute the theme using a composer package will make it easier for people to install the custom theme, you can specify any required packages in which composer can install / update for the user to ensure the theme installs correctly.Creating theme filesLet us now create our files one by one.

Creating theme files

Let us now create our files one by one.

theme.xml ( app/design/frontend/Venustheme/loftstyle_child/theme.xml )

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
   <title>Loftstyle Child</title> <!-- your theme's name -->
   <parent>Magento/blank</parent> <!-- the parent theme -->
   <media>
        <preview_image>media/preview.jpg</preview_image> <!-- theme's preview image -->
   </media>
</theme>

registration.php ( app/design/frontend/Venustheme/loftstyle_child/registration.php )

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'frontend/Venustheme/loftstyle_child',
    __DIR__
);

composer.json ( app/design/frontend/Venustheme/loftstyle_child/composer.json )

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

Please go to Admin -> Content -> Configuration

Then open Design Configuration -> choose Loftstyle child


* Important: After you choose new theme or new theme child, you need reindex data and run command below via SSH:

php bin/magento setup:static-content:deploy

Share this Post!

0 Comment

Do NOT follow this link or you will be banned from the site!