3

I am new to Magento theme development. I have gone through the frontend development guide and set up my child theme of the Magento Blank theme. I have done all that the guide says and added my css file but it is not showing on the frontend. Below is my setup. Any help would be great!

design/frontend/DouglasMedia/henryhiggs

Inside the folder henryhiggs it is:

|-etc
|  |-view.xml
|
|- Magnto_theme
|  |-layout
|      |-default_head_blocks.xml
|      |-default.xml
|
|-media
|   |-preview.jpg
|
|-web
|   |-css
|      |-custom.css
|   |-fonts
|   |-images
|   |-js
|
|-registration.php
|-theme.xml

Here is the code for default default_head_blocks.xml

<?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="//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" src_type="url"/>

    <css src="//fonts.googleapis.com/css?family=Montserrat:400,700" src_type="url"/>
    <css src="//fonts.googleapis.com/css?family=Roboto:400,100,300,500,700,900" src_type="url"/>
    <css src="css/custom.css" />

    <script src="jquery.js" />
    <script src="bootstrap/js/bootstrap.min.js" />
</head>

Here is the code for the theme.xml file

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
 <title>Henry Higgs Theme</title> <!-- your theme's name -->
 <parent>Magento/blank</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>

Let me know if I need to give any more code for any of the other files.

I have tried to run the following commands and then cleared the cache and so joy.

php bin/magento setup:upgrade --keep-generated
php bin/magento setup:static-content:deploy

Please let me know if I am missing anything.

Only other thing it might be is that there is no files under design/frontend/Magento/blank. I looked at another forum and they said it was ok as it is stored elsewhere. It seems to be the case as the "blank" theme is showing when I have my custom theme activated. Only cannot see any custom css I add.

Thanks in advance :D

2

Spelling mistake For theme and magento. Should be Magento_Theme, not Magnto_theme

  • 3
    @MurtuzaZabuawala it is correct answer. – Qaisar Satti Jan 11 '17 at 4:56
  • @QaisarSatti Thanks for this. I changed it and seems to work but only on all the other pages such as category and product pages. On the home page the css is not loading and to make it even stranger it shows the default Magento logo and not the site logo like all the other pages, any ideas? – Peter Wilkinson Jan 11 '17 at 8:51
  • Try to run bin/magento setup:static-content:deploy one more time to see if your issues resolved. – PY Yick Jan 11 '17 at 8:57
  • Thanks, tried that but no luck. :( – Peter Wilkinson Jan 11 '17 at 9:01
  • How about clear cache by bin/magento cache:flush? If still not working, check the CSS files itself. I think there are some override on styles. And, try to reupload your logo. – PY Yick Jan 11 '17 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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