How to insatall new theme on magento2

To setup a new theme on localhost is a easy step on magento2.
You can also see how to install magento2 on localhost

Step1:- Go to magento root directory folder and create 2 folder on inside it.

<MAGENTO2 ROOT DIRECTORY PATH>/app/design/frontend/<Vendorname>/<themename>

Here i am create a new theme with VENDOR-NAME = Csttheme
THEME-NAME = newtheme
Please take care small and captial letter.

My new theme path is below.

/app/design/frontend/Csttheme/newtheme

Step2: Create a theme.xml file inside theme folder and put below content on that file.

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

Step3: Now register your new theme on magento2.
Create a registration.php file and below content on that file.

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

Step4: Copy the media folder on the location

 <Magento root folder path>/vendor/magento/theme-frontend-luma/media

and put that folder on inside new theme.

<Magento root folder path>/app/design/frontend/Csttheme/newtheme/

Step5: Now set your new theme on Backend

 Content >> Configuration >> Edit "Main Website Store" and than select "Applied Theme" dropdown to your new theme.

Step6: Clear your folder cache inside var on root

<Magento root folder path>/var/

Step7: Refresh your url on your browser and see the blank theme will be dispaly.
For more clarification you can also chek view source of the page.

Leave a Reply