skip to Main Content

I created theme.xml with content below: (at: app/code/design/frontend/Vendor/theme_directory/theme.xml)

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
   <title>mytheme</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>

and despite I have “preview.jpg” at app/code/design/frontend/vendor/theme_directory/media/preview.jpg, it is not showing in admin.

3

Answers


  1. Your Path is already Wrong. So, it’s Not Getting on them.
    Please check below path:

    app/design/frontend/media/preview.jpg

    Login or Signup to reply.
  2. Theme Preview image loads from app/design/vendor/theme_directory/theme.xml file

    <media>
              <preview_image>media/preview.jpg</preview_image> 
    </media>
    

    put image on

     app/design/frontend/vendor/theme_directory/media/preview.png
    

    If this media tag and path to the image is not specified theme preview image will not be loaded. You can follow this link to learn about Magento 2 Themes and Theme creation
    You can check-in here: Magent2 Theme Overview

    Login or Signup to reply.
  3. I was able to fix that issues by deleting "design/theme/theme_id" from core_config_data table, and by deleting theme record from theme table as well. After that, I just activated theme again and thus, there is an image preview.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search