 <p>I guess you mean the category tree, And this should give you category tree. you can see the various filters being applied. (You can always do according to your need.)</p> <pre><code>&lt;?php $rootCatId = Mage::app()-&gt;getStore()-&gt;getRootCategoryId(); $catlistHtml = getTreeCategories($rootCatId, false); echo $catlistHtml; function getTreeCategories($parentId, $isChild){ $allCats = Mage::getModel('catalog/category')-&gt;getCollection() -&gt;addAttributeToSelect('*') -&gt;addAttributeToFilter('is_active','1') -&gt;addAttributeToFilter('include_in_menu','1') -&gt;addAttributeToFilter('parent_id',array('eq' =&gt; $parentId)) -&gt;addAttributeToSort('position', 'asc'); $class = ($isChild) ? "sub-cat-list" : "cat-list"; $html .= '&lt;ul class="'.$class.'"&gt;'; foreach($allCats as $category) { $html .= '&lt;li&gt;&lt;span&gt;'.$category-&gt;getName()."&lt;/span&gt;"; $subcats = $category-&gt;getChildren(); if($subcats != ''){ $html .= getTreeCategories($category-&gt;getId(), true); } $html .= '&lt;/li&gt;'; } $html .= '&lt;/ul&gt;'; return $html; } ?&gt; </code></pre> <blockquote> <p>EDIT: getting all parent category using an id/current category id..</p> </blockquote> <pre><code>$id = Mage::registry('current_category'); //or if you are retrieving other way around $category = Mage::getModel('catalog/category')-&gt;load($id); $categorynames = array(); foreach ($category-&gt;getParentCategories() as $parent) { $categorynames[] = $parent-&gt;getName(); } print_r($categorynames); //dumping category names for eg. </code></pre>