Adding ul class to main menu
-
Well there are tons of tutorials and forum posts on this. I’ve read a bunch but I just can’t figure out how to do it.
Could someone spell out how I accomplish this.Currently the html for my main (and only) menu looks like this.
<ul id="mobile_menu" class="et_mobile_menu" style="display: block;"><li id="menu-item-202676" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-202621 current_page_item menu-item-202676 et_first_mobile_item"><a href="https://ktotheatothei.com/">HOME</a></li> <li id="menu-item-202677" class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-202677"><a href="https://ktotheatothei.com/#about">ABOUT</a></li> <li id="menu-item-202679" class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-202679"><a href="https://ktotheatothei.com/#work">WORK</a></li> <li id="menu-item-202680" class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-202680"><a href="https://ktotheatothei.com/#connect">CONNECT</a></li> <li id="menu-item-202980" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-202980"><a href="https://ktotheatothei.com/creative-vault/">CREATIVE VAULT</a></li></ul> </ul>
I am doing some styling and would like to add a ul class “bmenu” that wraps around my li tags.
<ul id="mobile_menu" class="et_mobile_menu" style="display: block;"><ul class="bmenu"><li id="menu-item-202676" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-202621 current_page_item menu-item-202676 et_first_mobile_item"><a href="https://ktotheatothei.com/">HOME</a></li>...
In this support post. This was solved by adding this code:
<?php wp_nav_menu( array('menu' => 'Main', 'container' => '', 'items_wrap' => '<ul id="mymenu">%3$s</ul>' )); ?>
But I have no idea what file this code goes in. Nor do I know what parts to replace for my specific situation.
I did create a custom menu in wordpress. The name I gave the menu is Home Page Menu
Also I am using the mobile menu with the desktop layout not sure that has any impact.Thanks for your guidance.
website: https://ktotheatothei.com
- The topic ‘Adding ul class to main menu’ is closed to new replies.