How to Get Current Category Image in Magento 2

categorymagento2

How can I retrieve the category image (url) in the list.phtml file?

I am currently using this to get the current category:

<?php $category = $_objectManager->get('Magento\Framework\Registry')->registry('current_category'); ?>

But I don't know how to get the image url using $category?

Best Answer

We can try with $category->getImageUrl())

Take a look: vendor/magento/module-catalog/view/frontend/templates/category/image.phtml

Related Topic