Magento 2.0 Theme Not Working in 2.1

cssdeploymagento-2.1magento2

I created a theme in magento 2.0 that was working. Now, I updated the magento version to 2.1 and deployed the theme. The files get generated in pub/static folder but CSS files are not loading in head section. I am loading the CSS files as below:

default_head_blocks.xml

 <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>

        <css src="css/test.css" />
        <css src="css/owl.carousel.css" />
        <link src="js/owl.carousel.js"/> 

    </head>
</page>

Best Answer

I was facing the same problem and did the following steps to fix it

  1. First make a backup of your theme from app/design/frontend/theme
  2. Set the blank theme from admin->content->configurations for your store
  3. delete the theme from admin->themes->your-theme
  4. also delete it form folder app/design/frontend/theme
  5. then run upgrade and deploy commands.
  6. then place your theme again in folder app/design/frontend/theme
  7. run upgrade command.
  8. select your theme from admin->content->configurations->your-theme for your store.
  9. and run deploy command.

Hope it will work for you also.

Related Topic