How to get Current Category in Magento?

Posted by Damodar Bashyal on March 07, 2012

 

In Magento, If you are on category page than it's easy to get current category.

$_current_category=$this->getCurrentCategory();

or,

$_current_category = Mage::registry('current_category');

I needed Current Category on product info page and on the footer.phtml files. Because I had custom background set for each Category. So, Below code helped me to find the Current Category in my Magento's phtml file.

More»

QR Code: How to get Current Category in Magento?