Magento – installing a theme

theme

I am trying to install theme porto in vain. Here is where I am getting a problem on the instructions. Active SW Extensions, open command line in folder root of magento and run commands, php bin/magento setup:upgrade

what is active SW extension?

I opened the command line and initiated php bin/magento setup:upgrade, however, it prompts me to rerun magento compile command.

I have run the compile command, ./magento setup:di:compile
compilation starts and stops after repositories code generating line. Please help.

Best Answer

When adding a theme into a Magento 2 install, you don't have run any command line to see if the theme is being seen by Magento. If the code is added to the correct path app/design/frontend/{{vender_namespace}}/{{theme_name}} then the registration.php file will automatically be seen and show up in the admin as a theme to select.

You should be able to navigate to the theme selection in the admin store-> settings-> config-> general-> design-> design theme

If you don't see your theme there, it's installed in the wrong location in the file structure or the registration.php is not correct.

Once you set the theme in the admin, then run the php bin/magento setup:static-content:deploy command from the root of your Magento install and the files will compile into the pub/static folder.

Running the php bin/magento setup:upgrade command is only needed when installing extensions, which the theme might have packaged in some way. But I have found that most theme developers are still finding out how to package themes, with no clear pattern as of yet. And the only time you need to run the php bin/magento setup:di:compile is when you are getting ready to shift from developer mode to production. The message in the command line that tells you to run that seems to be a hold over from the beta days that never got removed. While developing, I have never needed to use it.

Related Topic