title: Magento get categories and list in navigation in .phtml file
body: <p>Ok so I've copied and pasted like 10 inserts already for php code to list the main categories or the sub categories under the Default root category.</p>
  
  <p>None of them are displaying my categories and I have all my categories as root categories AND sub-categories under the Default root category to see if both scenarios will work..</p>
  
  <p>Here is my php code I have in my theme .phtml file (1-column so far)</p>
  
  <pre><code>                &lt;?php $_categories = Mage::helper('catalog/category')-&gt;getStoreCategories(); ?&gt;
                  &lt;?php if (count($_categories) &gt; 0): ?&gt;
                  &lt;ul&gt;
                      &lt;?php foreach($_categories as $_category): ?&gt;
                          &lt;li&gt;
                              &lt;a href="&lt;?php echo $_helper-&gt;getCategoryUrl($_category) ?&gt;"&gt;
                                  &lt;?php echo $_category-&gt;getName() ?&gt;
                              &lt;/a&gt;
                          &lt;/li&gt;
                      &lt;?php endforeach; ?&gt;
                  &lt;/ul&gt;
                  &lt;?php endif; ?&gt;
  </code></pre>
  
  <p>I know I have them setup right in the admin panel because I have them both as root and subcategories which shouldn't be necessary of course. I'm just trying everything to get them to display and nothing seems to be working..</p>
  
  <p>Anyone know?</p>
  
  <p>EDIT
  Ok I found it in topmenu.phtml in the html directory under the template directory in the page directory:</p>
  
  <pre><code>&lt;?php $_menu = $this-&gt;getHtml('level-top') ?&gt;
  &lt;?php if($_menu): ?&gt;
  &lt;div class="nav-container"&gt;
      &lt;ul id="nav"&gt;
          &lt;?php echo $_menu ?&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  &lt;?php endif ?&gt;
  </code></pre>
  
  <p>Where is the getHtml('level-top') code at so I can alter the markup of the li elements?</p>