0

I hope somebody can help me out, I've tried doing it a million times again but somehow my theme doesn't show up in the backend of my Magento 2 installation. Here are my files:

app/design/frontend/Company/default/theme.xml

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Company Default</title> 
<parent>Magento/blank</parent> 
<media>
    <preview_image>media/preview.jpg</preview_image> <!-- the path to your theme's preview image -->
</media>
</theme>

app/design/frontend/Company/default/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/Company/default',
__DIR__
);

app/design/frontend/Company/default/composer.json

{
  "name": "company/default",
  "description": "N/A",
  "require": {
  "php": "~5.5.0|~5.6.0|~7.0.0",
  "magento/theme-frontend-blank": "100.0.*",
  "magento/framework": "100.0.*"
},
  "type": "magento2-theme",
  "version": "100.0.1",
  "license": [
  "OSL-3.0",
  "AFL-3.0"
],
"autoload": {
  "files": [
    "registration.php"
  ]
 }
}

I've cleaned the cache, added a media folder inside my themes file with a preview.jpg image and ran composer update, which keeps saying there is nothing to install. And cleaned the cache again. Logged in and out of my admin panel, but no luck. What am I missing here?

1
  • 2
    Have you run setup upgrade command Jul 3, 2016 at 12:34

2 Answers 2

1

Just run command for upgrade

php bin/magento setup:upgrade

Remove var from root folder

Remove pub/static files and folder content.

Run command

php bin/magento setup:static-content:deploy
9
  • I did that, and now my theme is showing up in the backend but I can't seem to change it. However, without having changed the theme my frontend is now all messed up, it is trying to load stylesheets from the luma theme with a 404 and stuff. How can this happen?
    – magin
    Jul 3, 2016 at 12:55
  • I have update my answer Jul 3, 2016 at 12:58
  • Have you work above solutions Jul 3, 2016 at 13:04
  • I'm currently running the last command from your updated answer. Will keep you posted, thanks so far!
    – magin
    Jul 3, 2016 at 13:05
  • Ran all of the commands but still my entire frontend is messed up since js and css are no longer loading :( @rakesh
    – magin
    Jul 3, 2016 at 13:10
0

Since you're using composer I would do a composer update and then remove pub/static/ and then php bin/magento setup:static-content:deploy like Rakesh said in previous answer.

composer update
rm -r pub/static/
php bin/magento setup:static-content:deploy

To not have it show a blank frontend once you have selected your theme you should ensure that preview.jpg exists.

I solved this issue on my version by ensuring that preview.jpg was copied from the theme I inherited from or that it is available. Since you reference that preview.jpg file you should make sure it is in your theme directory or you will have issues. My issue was what you described with it being a blank frontend. Luma does have one and it also inherited from blank like your theme does here.

Your Answer

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

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