I purchased a theme for a Magento 2 website. I know want to create a child theme to modify some of the styles, etc.
The theme purchased is called Porto and resides in
/app/design/frontend/Smartwave/porto
So I created a directory
/app/design/frontend/Smartwave/porto_child
I then created a theme.xml file with the below contents
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Proto Child</title> <!-- your theme's name -->
<parent>Smartwave/porto</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>
I then created a registration.php file
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::THEME,
'frontend/Smartwave/porto_child',
__DIR__
);
I also created a directory called media and put a preview.jpg in there now when I go to the admin panel I get an error when I view the log in the var/report folder I see an error that says
a:4:{i:0;s:107:"File '/var/www/app/design/frontend/Smartwave/porto_child/media/preview.jpg' does not exists."
When I SFTP to the directory I see the file!
When I run (on the command line)
mage setup:upgrade
I get a message that says
[Exception] File'/var/www/app/design/frontend/Smartwave/porto_child/media/preview.jpg' does not exists.
Also When i run sudo bin/magento setup:static-content:deploy -t Smartwave/porto_child
[InvalidArgumentException] Smartwave/porto_child argument has invalid value, available themes are: Magento/blank, Magento/luma, Magento/backend, Smartwave/porto_rtl, Smartwave/porto
theme
it should be of type 0 (psychical) and not 1 (virtual). There were various issues with themes because of it. magento.stackexchange.com/questions/92181/…