If you are one of those who are facing issue "Unable to load theme" while registering a new Magento theme.
You might be experiencing below errors even after creating a new Magento2 theme and properly placing all the necessary files registration.php and theme.xml.
Solution:
The issue could be file permission of the theme files. Strange!
The theme registration issue should be resolved when you access your Magento2 store and run static-content:deploy command. "Unable to load theme" should be gone from console now.
You might be experiencing below errors even after creating a new Magento2 theme and properly placing all the necessary files registration.php and theme.xml.
- 'theme' table in database does not show your theme entry.
- Content > Design > Theme in admin panel does not show your newly created theme entry.
- setup:static-content:deploy command stuck while processing your theme.
Solution:
The issue could be file permission of the theme files. Strange!
- Login as Magento file system owner.
- Navigate to Magento2 installation location.
- Run below commands.
chown -R :nginx .
(replace 'nginx' by your web server user group name)
find . -type d -exec chmod 770 {} \; && find . -type f -exec chmod 660 {} \; && chmod u+x bin/magento
The theme registration issue should be resolved when you access your Magento2 store and run static-content:deploy command. "Unable to load theme" should be gone from console now.