title: How to customize the list of categories in WordPress
body: <p>I have the following HTML and would like the output of the list of my WordPress was consistent with it. Categories without children would be within a <code>&lt;li&gt;</code> categories with children already enter into a dropdown menu. HTML and JS to all this work is perfect, but I knew not create the function to return the WordPress categories in this format.</p>
  
  <pre><code>   &lt;ul class="nav"&gt;
          &lt;li&gt;&lt;a href="#"&gt;Categoria 1&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#"&gt;Categoria 2&lt;/a&gt;&lt;/li&gt;
          &lt;li class="dropdown"&gt;
              &lt;a data-toggle="dropdown" class="dropdown-toggle" href="#"&gt;Categoria 3&lt;b class="caret"&gt;&lt;/b&gt;&lt;/a&gt;
              &lt;ul class="dropdown-menu"&gt;
                  &lt;li&gt;&lt;a href="#"&gt;Categoria 3.1&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href="#"&gt;Categoria 3.2&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
          &lt;/li&gt;
          &lt;li&gt;&lt;a href="#"&gt;Categoria 4&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#"&gt;Categoria 5&lt;/a&gt;&lt;/li&gt;
          &lt;li class="dropdown"&gt;
              &lt;a data-toggle="dropdown" class="dropdown-toggle" href="#"&gt;Categoria 6&lt;b class="caret"&gt;&lt;/b&gt;&lt;/a&gt;
              &lt;ul class="dropdown-menu"&gt;
                  &lt;li&gt;&lt;a href="#"&gt;Categoria 6.1&lt;/a&gt;&lt;/li&gt;
                  &lt;li&gt;&lt;a href="#"&gt;Categoria 6.2&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt;
          &lt;/li&gt;
      &lt;/ul&gt;
  </code></pre>
  
  <p>Can anyone help?</p>