I upgraded a website from 2.0.5 to 2.1.5. The website uses a custom theme.
In this theme, I added some css to include in the layout
app\design\frontend\Vendor\themename\Magento_Theme\layout\default_head_blocks.xml
But none of the CCC are being included in the head tag in frontend. The upgraded website uses the correct theme, because it loads the content of phtml for example.
1 Answer 1
Make sure the syntax are correct
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>
<css src="css/custom.css" />
</head>
</page>
Also, make sure that CSS is on your following path
app/design/frontend/package/theme/web/css/custom.css
And run the following commands
php bin/magento setup:upgrade
php -d memory_limit=1G bin/magento setup:static-content:deploy
php bin/magento cache:flush
If still not working, Clear your browser cache or try different browsers.
-
It is solved. I don't know exactly what is the point that I have missed, but I did not re-run the upgrade command when it was not working, but only deployment and flush cache. So I re-ran one by one the command lines you mentionned. I made a change in theme table too: all my theme type was set to virtual (1 value) and I changed it to physical (0 value). And I used a theme that have a parent, so I put in the child theme some parents files.Mirindra– Mirindra2017年12月06日 08:32:23 +00:00Commented Dec 6, 2017 at 8:32
-
@Mirindra : Glad you resolved itKaushal Suthar– Kaushal Suthar2017年12月06日 10:18:00 +00:00Commented Dec 6, 2017 at 10:18