I found the answer to this for Magento 1.x, but I can't find a 2.0x solution.

On my category pages, before the products are shown, there is a huge image, "category-image".

Does anyone know where the phtml file is that loads this image?

Thanks so much!

  • It would be great if you can share screen shot that may help me to understand which image of category are you talking about. – Aman Alam Jun 22 '16 at 18:16

You can find this in your theme


If you don't find the file here then you can create your own with same name having content:

    $_helper    = $this->helper('Magento\Catalog\Helper\Output');
    $_category  = $block->getCurrentCategory();
    $_imgHtml   = '';
    if ($_imgUrl = $_category->getImageUrl()) {
        $_imgHtml = '<div class="category-image"><img src="' . $_imgUrl . '" alt="' . $block->escapeHtml($_category->getName()) . '" title="' . $block->escapeHtml($_category->getName()) . '" class="image" /></div>';
        $_imgHtml = $_helper->categoryAttribute($_category, $_imgHtml, 'image');
        /* @escapeNotVerified */ echo $_imgHtml;

and you can modify it as you want. :)

Magento uses fallback method so this file is initially placed in Magento_Catalog::view/frontend/templates/category/image.phtml
You can overwrite it in your theme.

| improve this answer | |
  • Thanks so much for this help. I had found this file earlier, and assumed this was what I needed to change, but was unsure on how to completely remove the image without causing a broken link. – Jeremy Lester Jun 22 '16 at 19:56

Go to vendor\magento\module-catalog\view\frontend\templates\category and look for file image.phtml. This file is responsible to display Category image before rendering products. You can override this file in your magento designed theme, and can modify as per your requirements.

| improve this answer | |

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.