I am pretty new to wordpress and am having trouble creating the primary navigation for the site.
I am using wp-nav-menu to output my dynamic menu.
The code I would like to output is the following...
<ul class="mainNav">
<li><a href="">Home</a></li>
<li class="dropdown">
<a href="">Treatments<span></span></a>
<ul>
<li><a href="">Body Treatments</a></li>
<li><a href="">Make Up</a></li>
<li><a href="">Skincare</a></li>
</ul>
</li>
<li><a href="">Latest News</a></li>
<li><a href="">Aftercare</a></li>
<li><a href="">Contact</a></li>
</ul>
The code I have used to get the menu above is this...
<?php wp_nav_menu(
array(
'menu' => 'Primary Navigation',
'items_wrap' => '<ul class="mainNav">%3$s</ul>'
)
); ?>
This gets me the main menu but I do not know how to get the <li>
with the class of dropdown. I would also like to place a <span>
inside one of the links, as you can see in my HTML code.
Any help would be greatly appreciated!
I have figured it out and will write it here in case anyone has the same problem.
In the wordpress admin, there is a link called screen options. Open this, and tick CSS classes, you can then add individual classes to menu items.