Apply / Change Theme in Magento 2

Apply theme in magento 2

In this article, I am going to explain how to apply the theme in Magento 2. If you reading my article for the first time, I suggest you read my previous article on Theme Concept in Magento 2Layout Overview in Magento 2, and Configure Theme Properties in Magento 2.

In previous articles, we have successfully created a theme. Now I am going to show step by step process to apply the theme to a storefront.

Step 1: Login Magento Admin > Content > Configuration

Content > Configuration

Step 2: Design Configuration > Click on edit

Design Configuration > Click on edit

Step 3: Select Theme > Save Configuration

Select Theme > Save Configuration

Step 4: Flush Magento Cache

$ php bin/magento c:f
$ php bin/magento c:c

Now, we have successfully applied the theme for the storefront.

Check if your theme applied to the storefront or not?

Check if your theme applied to the storefront or not?
Check if your theme applied to the storefront or not?

In the above picture, you can see our theme “Aryan_Tutorial” is applied on the storefront.

Apply different Theme for User-agent :

As per requirement, sometimes we have to set different themes for the user agents. For example, we will apply the “Magento Luma” theme for mobile:

Magento Admin > Content > Configuration > Click edit > Add New User Agent rule > Save Configuration

Magento Admin > Content > Configuration > Click edit > Add New User Agent rule > Save Configuration

After the above configuration, do Magento cache flush.

APPLY A TEMPORARY THEME CONFIGURATION TO A STORE VIEW


What is the purpose of temporary theme?

This is to automate the design change on specific occasions. For example, if we want to configure a different theme for three days on the occasion of HOLI.

How does it affect rendering if a design change is scheduled?

On the selected day, the theme is applied to the storefront as a primary theme. On the end day, it automatically changed to the Main theme.

Note: Only one design change can be scheduled at a time. Magento does not allow scheduled multiple designs to change at a time.

Step 1: Admin > Content > Schedule

Admin > Content > Schedule

Step 2: Store Design Schedule > Fill entry > Add Design Change

Design Schedule > Fill entry > Add Design Change

You can schedule your change here, under Store select your store where need to change the design, Design select your theme ( scheduled theme ), Date From is the start day of design scheduled, and Date To is the end date.


Hope this article helped you understand how to apply or change the theme in Magento 2. If you have any queries, ask me at aryansrivastavadesssigner@gmail.com or contact me here.

If you like this article, you can buy me a cup of coffee Buy me a Coffee.

About Aryan Srivastava

I’m a Passionate Magento 2 Frontend Developer. I have 2.5+ years of experience in Frontend. I cherish taking up complex problems and turning them into the best layout in the easiest and proper way. I love to work on Magento 2 e-Commerce Solutions.

View all posts by Aryan Srivastava →

Leave a Reply

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