I was able to use <?php wp_nav_menu( array( 'theme_location' => 'primary-menu', 'container' => false ) ); ?>
to create the menu within my theme. Messed around with ‘items_wrap’ but couldn’t get it to display correctly.
I need to add an image and container div into the sub menu ul before the li’s. This is the structure I want:
<ul id="nav">
<li><a href="#">Page</a>
<ul>
<img src="<?php bloginfo('template_directory'); ?>/images/nav_ul_tab.png" class="nav_ul_tab" />
<div class="nav_spacer">
<li><a href="#">Sub Page</a></li>
<li><a href="#">Sub Page</a></li>
<li><a href="#">Sub Page</a></li>
</div>
</ul>
</li>
</ul>
What you want is invalid markup. The only children an
ul
can have areli
. Use CSS instead:We can insert the image via Jquery. Here is the code. Before execute this code make sure JQuery JavaScript should be load in your page.