How to display only level 0 category in nav magento

I want to display only category 0 category in navigation, how can I do this? Are there any settings, or do I need to change the code? The menu is currently displayed by code <?php echo $this->getChildHtml('topMenu') ?>.

+3
source share
1 answer

I got this, we can do this by changing the global settings, goto sysytem → configration-> catalog-> Category Top Navigation and set the “Maximum Depth” to 1, then save the config and clear the cache.

+2
source