Minimog Documentation
  • 1. INTRODUCTION
    • Getting Started
    • Free Support
  • 2. THEME INSTALLATION
    • How To Install
      • Quick_Start_Package
      • Base_Start_Package
    • Activation Purchase Code
    • One Click Demo Import
    • Apply A Template
    • Create Child Theme
    • Translations
  • 3. Magento2 Knowledgebase
    • User Guide
  • 4.THEME CUSTOMIZE
    • Theme Settings
      • General
      • Header
      • Footer
      • Category
      • Product
      • Blog
      • Newsletter Popup
      • Product popup
    • Theme Design
  • 5.OUR MODULE
    • Product Widget Advanced
    • Delivery & Return
    • Ajax Suite
    • Menu Builder
    • Quick View
    • Instagram
    • Lookbook
    • Optimize Speed
    • Product Questions
    • Product Size Charts
    • Search Suite
    • Layered Ajax Settings
    • Store Locator
  • 6. Page Builder
    • User Guide
    • Minimog Elements
      • Static Menu
      • Revolution Slideshow
      • Icon Box
      • FAQs
      • Blog Posts
      • Lookbook
      • Category Thumbnail
      • Image Box
      • Testimonial
      • Instagram
      • Quote
      • Product Advanced
      • Product group home page
      • Product Countdown Timers
      • Popup Newsletter
      • Gallery
      • Daily Deal
      • Banner
      • Custom Banner
      • Copy page builder layout
      • Newsletter Form
  • 7. EXTERNAL MODULE
    • Revolution Slider
    • Magento 2 Blog
    • Magenest GiftCard
  • 8. Frequently Asked Questions
    • Magento information
    • Upload logo and favicon
    • Config store view
    • Store Details
    • Include the store code in URLs
    • How to Configure the Default Page in Magento 2
    • How to Setup Multiple Websites in Magento 2
    • How to Change Store Scope in Magento 2
    • How to Add a New CMS Page in Magento 2
    • How to Add New CMS Blocks in Magento 2
    • How to custom cms block page Contact Us
    • How to set Default Category Layout in Magento 2
    • How to enable Cookie Law Compliance
    • Categories
      • Magento 2. How to Set the Category Thumbnail Image
      • How to create a new Category in Magento 2
      • Setup root category
    • Product
      • 6 Product Types in Magento 2 Explained & Examples
      • How to Configure Product layout
      • How to Setup Special Price in Magento 2
      • How to Setup Advanced Pricing in Magento 2
      • How to Configure Related, Up-Sell, Cross-Sell Products in Magento 2
      • How to setup Back in stock notification product
    • Speed up Magento 2
  • 9. Video tutorial Library
    • Playlists
Powered by GitBook
On this page
  • Why do you need Create Child Theme in Magento 2
  • How to Create Child Theme in Magento 2
  1. 2. THEME INSTALLATION

Create Child Theme

Why do you need Create Child Theme in Magento 2

If you want to modify certain aspects of the our theme preserving the original files and ensuring all changes are saved after Magento is updated, you need to create a child theme.

Theme inheritance enables you to easily extend themes and minimize the maintenance efforts. You can use an existing our theme as a basis for customizations, or minor store design updates, like holidays decoration. Rather than copy extensive theme files and modify what you want to change, you can add overriding and extending files.

How to Create Child Theme in Magento 2

Create a child theme so that all your custom themes in go here:

../app/design/frontend/company_name/theme_name

  • company_name: is your company name

  • theme_name: is child theme

The theme has the following directory structure:

<app>
     <design>
          <frontend>
              <company_name>
                  <theme_name>
                      <media>
                           preview.png
                      <web>
                           <css>
                           <fonts>
                           <images>
                           <js>
                  theme.xml
                  registration.php
  • company_name -> is the name of the theme package

  • theme_name -> is the name of the theme. Use multiple theme names inside the company_name folder.

  • media/preview.png -> is the preview of the current theme.

  • web -> is a directory that contains all the theme’s static data including images, styles, javascript, fonts, etc.

  • registration.php -> is a file required for registering your new theme to the Magento 2 system.

  • theme.xml -> is a compulsory file that defines your theme name, its parent, and (optionally) theme’s preview image.

Now, it is necessary to create theme files.

../app/design/frontend/company_name/theme_name/theme.xml

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
   <title>Theme Name</title>
   <parent>bluesky/bluesky_minimog_default</parent>
   <media>
        <preview_image>media/preview.png</preview_image>
   </media>
</theme>

../app/design/frontend/company_name/theme_name/registration.php

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

Your new child theme is ready. You need run deploy, clear the cache and select it from admin.

Step 1: Login SSH via putty or termius

Step 2: cd to root magento folder

Step 3: Run command:

  • php bin/magento cache:flush

  • php bin/magento indexer:reindex

  • php bin/magento setup:upgrade

  • php bin/magento setup:static-content:deploy -f

  • chmod 777 -R pub var generated (If you use Linux)

Step 4: In the Admin, go to Content -> Design -> Themes. Your theme should be listed here. Now, visit Stores -> Configuration -> Design. Choose “Main Website” in front of “Store View” at top left and click Design -> Design Theme. One of the last steps requires unchecking “Use Default” and picking your theme. Don’t forget to click “Save Config” and clear your cache.

PreviousApply A TemplateNextTranslations

Last updated 2 years ago