cancel
Showing results for 
Search instead for 
Did you mean: 

Some css & js files not loading from custom theme on frontend

Some css & js files not loading from custom theme on frontend

I have installed Magento CE 2.1.2 in my local system Windows 7(64 bit) Uwamp.

Now I have created my custom theme and set it up in the backend. Below are the theme specific files and I have kept some folders like `web/css/source`, `web/fonts`, `web/images` etc. empty, as I want those files to be called directly from parent theme.

C:\UwAmp\www\testmage212\app\design\frontend\Vivek\Custom\registration.php:
------------------------------------------------------------------------

<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::THEME,
'frontend/Vivek/Custom',
__DIR__
);

C:\UwAmp\www\testmage212\app\design\frontend\Vivek\Custom\theme.xml:
--------------------------------------------------------------------

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Custom</title> <!-- your theme's name -->
<parent>Magento/luma</parent> <!-- the parent theme, in case your theme inherits from an existing theme -->
<media>
<preview_image>media/preview.jpg</preview_image> <!-- the path to your theme's preview image -->
</media>
</theme>

C:\UwAmp\www\testmage212\app\design\frontend\Vivek\Custom\Magento_Theme\layout\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/source/style.css" />
</head>

and

C:\UwAmp\www\testmage212\app\design\frontend\Vivek\Custom\media\preview.jpg
========================================================================

which is copied from Luma Theme.

After setting this same theme from backend, everything else works fine with new theme on frontend, but some css & js files are not being called from the parent theme, which results in icons and logo not displaying at all in frontend Homepage, Product Listing page etc. Also the "Hot Sellers" products block from Homepage disappeared.

Any hints on what could be the issue and how to resolve this ?