4

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>
15
  • 2
    Try this app/design/frontend/theme/web/css/test.css. I also face same problem after this it's working for me
    – Magento 2
    Commented Aug 22, 2016 at 11:54
  • @Kothari do you understand the question? Commented Aug 22, 2016 at 11:55
  • Oh Sorry @Qaisar Satti No Idea
    – Magento 2
    Commented Aug 22, 2016 at 11:56
  • plz show your xml file Commented Aug 22, 2016 at 12:05
  • 1
    Have you keep above file at proper location? may be you have forgot to put file at proper location Commented Aug 22, 2016 at 12:15

1 Answer 1

7

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.

10
  • Is possible magento 2.0.0 theme fot magento 2.1.7?
    – zus
    Commented Mar 26, 2018 at 5:51
  • @Qaisar Satti AFter applied the theme the screen look like snag.gy/25jdHU.jpg
    – zus
    Commented Mar 26, 2018 at 5:53
  • @zus you need to deploy theme content just follow blog.qaisarsatti.com/magento_2/… Commented Mar 26, 2018 at 5:59
  • @QaisarSatti Still not working, may i know the proper way to import magento 2 themes.
    – zus
    Commented Mar 26, 2018 at 6:08
  • @zus the problem you showing is image is related to static content. for import the data of custom theme. there will be configuration for that. Commented Mar 26, 2018 at 6:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.