Hi everybody! I have to add custom HTML ONLY when I have level-02 at my menu navigation. I was looking 3 days and can’t find an answer for that!
Can’t find a solution either to show the level-03. Need help with this too!Here’s my code:
<ul id="level-01"> <li> <a href="#"> <!-- CUSTOM HTML AT LEVEL-01, IF I HAVE LEVEL-02 --> <span class="menu-item-hover"> <span class="submenu-item-hover" /> <span class="arrow-hover" /> </span> <!-- TITLE OF MY MENU --> <span class="title">Home</span> <span class="arrow" /> <!-- END OF CUSTOM HTML AT LEVEL-01, IF I HAVE LEVEL-02 --> </a> <ul class="level-02"> <li> <a href="#">With NivoSlider</a> <ul class="level-03"> <li><a>Subitem01</a></li> <li><a>Subitem02</a></li> </ul> </li> </ul> </li> <li><a href="#">Menu without Level-02</a></li> <li><a href="#">Other menu without Level-02</a></li> <ul /></ul>
Well, I tried a lot of things, and can’t find a solution. Custom Walkers, Custom classes. Please I need help to finish this project!
I have a HTML to show this: http://aprj.net/etc/news
Regards, Anderson Lucas.
I don’t understand your issue. If you make a menu in WordPress and then put in pages and put them into a sub menu, WordPress will automatically generate the html needed. Then you just have to style that for the sub nav. Maybe you made your menu incorrectly in the admin area? The code to generate your menu should look something like this
wp_nav_menu( array( ‘container_class’ => ‘menu-header’, ‘theme_location’ => ‘primary’ ) ); ?>
so none of the above html should be needed
To me you don’t really need all the extra HTML . You can achieve the effect that you linked to via pure CSS . The only thing that you actually need is a class (for example ‘parent’) for an item that has sub-items. I can help you with that if you want.