Magento - Listing all Categories in footer

Magento - Listing all Categories in footer

September 4, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento - Listing all Categories in footer

Displaying All Active Categories in Magento Footer

In this guide, we’ll walk through the process of displaying all active categories in your Magento footer section. This can be particularly useful for enhancing user navigation and improving site structure.

Getting Started

Before beginning, make sure you have access to your Magento admin panel. If not, log in using your credentials at https://yourstore.com/admin/.

Next, navigate to the “CMS” > “Pages” menu. Here, locate and open the footer page where you want the categories to appear (usually named something like “footer”).

Retrieving All Active Categories

To fetch all active categories from Magento, we’ll use the Mage_Core_Model_Resource_Collection class along with the enabled field in our selection. Here’s how to do it:

$category = Mage::getModel('catalog/category');
$allCategories = $category->getCollection()
    ->addFieldToFilter('is_active', 1)
    ->load();

In this example, we create a new category model object and then call the getCollection() method to retrieve all categories. The addFieldToFilter() function ensures that only active (enabled) categories are returned.

Now that we have our list of active categories, it’s time to display them in the footer content. We’ll use a simple foreach loop to iterate through each category and output its name as an unordered list item (

  • ).

    To do this, add the following code inside your footer content area:

    <ul class="footer-categories">
        <?php if (count($allCategories) > 0): ?>
            <?php foreach ($allCategories as $category): ?>
                <li><a href="<?php echo $this->getUrl('catalog/category/view', array('id' => $category->getId())); ?>"><?php echo $category->getName(); ?></a></li>
            <?php endforeach; ?>
        <?php else: ?>
            <li>No active categories found.</li>
        <?php endif; ?>
    </ul>
    

    This code creates an unordered list with the class “footer-categories”. It then checks if any active categories exist. If they do, it loops through each category and generates a link to that category’s page using getUrl(). The category name is displayed as the link text.

    To style your footer categories, add some CSS to your theme’s stylesheet (usually located in /skin/frontend/your_theme/css/style.css). For example:

    .footer-categories {
        list-style: none;
        padding: 0;
    }
    
    .footer-categories li {
        margin-bottom: 5px;
    }
    

    This CSS removes the default bullet points from the unordered list and adds some vertical space between each item for better readability.

    Conclusion

    Displaying all active categories in your Magento footer can significantly improve user experience by providing easy access to various product sections. By following this guide, you’ll have successfully integrated this feature into your store’s design.

    Remember that proper theming is essential, so don’t hesitate to customize the appearance of the footer categories to match your site’s overall look and feel.

    If you’re looking for more advanced Magento customization techniques or need professional assistance with your e-commerce development needs, consider reaching out to the experts at Laravel Company.

    They offer a wide range of services, including Magento theme development, module creation, and comprehensive support to ensure your online store runs smoothly and efficiently. Don’t hesitate to explore their offerings for top-notch Magento solutions tailored to your business requirements.

    Happy coding!

  • Catalog Admin Orders

    Our network