title: Create sub-menu in Wordpress
body: <p>I have the following code;</p>
  
  <pre><code>      &lt;!-- Primary navigation --&gt;  
    &lt;nav class="sixteen columns primary"&gt;
      &lt;ul id="nav"&gt;&lt;!-- This ID (nav) is used to identify which menu is used for the mobile menu --&gt;  
          &lt;?php
  
              $args = array(
                  'menu' =&gt; 'main-menu',
                  'echo' =&gt; false
              );
  
              echo strip_tags(wp_nav_menu( $args ), '&lt;a&gt;&lt;li&gt;');
          ?&gt;
      &lt;/ul&gt;
    &lt;/nav&gt;
  </code></pre>
  
  <p>Which creates this code for my WordPress menu</p>
  
  <hr>
  
  <pre><code>nav class="sixteen columns primary"&gt;
  ul id="nav"&gt;&lt;!-- This ID (nav) is used to identify which menu is used for the mobile menu --&gt;
  
  li id="menu-item-14" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-8 current_page_item menu-item-14"&gt;&lt;a href="http://www.testsite123-abc.com/"&gt;Home&lt;/a&gt;&lt;/li&gt;
  
  li id="menu-item-13" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-13"&gt;&lt;a href="http://www.testsite123-abc.com/about-me/"&gt;About Me&lt;/a&gt;&lt;/li&gt;
  li id="menu-item-17" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-17"&gt;&lt;a href="http://www.testsite123-abc.com/portfolio/"&gt;Portfolio&lt;/a&gt;
  
  li id="menu-item-76" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-76"&gt;&lt;a href="http://www.testsite123-abc.com/portfolio/folio-1/"&gt;folio-1&lt;/a&gt;&lt;/li&gt;
  
  /li&gt;
  
  li id="menu-item-20" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-20"&gt;&lt;a href="http://www.testsite123-abc.com/contact-me/"&gt;Contact Me&lt;/a&gt;&lt;/li&gt;
  /ul&gt;
  
  /nav&gt;
  
  ---
  </code></pre>
  
  <p>This works well on Wordpress and the <a href="http://lukaszfiszer.github.io/selectnav.js/" rel="nofollow">jsSelectNav</a> mobile menu, but my problem is that the link folio-1 is a child page of Portfolio, but I think because of the strip_tags function the ul tags for it are stripped out, if I set them as not to be stripped out extraneous ones get added which prevent the menu from working as well.</p>
  
  <p>Is there any way I can get this to work or is there other code that would do what I needed.</p>
  
  <p>Thanks</p>
  
  <p>PS tried and failed to add the output code in the end I had to add it as text without the opening &lt; please feel free to correct it.</p>