Back to Blog

How to create theme in Magento 2

How to create theme in Magento 2-

1. Install magento 2.
2. Go to admin panel and login.
3. Now you may see this window ( links not working )

4. To solve the issue, open your xampp shell

5. Specify your path

6.  Run following command from Magento root:
php bin/magento setup:static-content:deploy

7. Go to admin panel and check if the issue has fixed. You can see the admin panel like this.

8. Now you can start with creating your custom theme.
9. At first, create your folder in C:\xampp\htdocs\Magento2_new\app\design\frontend\ and create your folder within

10. Add or copy from an existing theme.xml to your theme directory app/design/frontend/

11.  Add a composer.json file to the theme directory and register the package on a packaging server.

12. To register your theme in the system, in your theme directory add a registration.php file with the following content:

13. Copy a media folder from an existing theme to your theme directory.
14. Create directories for static files. Your theme will likely contain several types of static files: styles, fonts, JavaScript and images. Each type should be stored in a separate sub-directory of web in your theme folder:

15. At this point your theme file structure looks as follows:

16. Your theme is created now. Login to admin panel and go to Stores -> Configuration -> Design, you can see your theme. Select your theme and save it.

17. Run the following commands for static content deployment and database update from your root directory
php bin/magento setup:static-content:deploy
php bin/magento setup:upgrade
18. You can customize your site now, using your own theme.

Back to Blog
top