I’m building my first website on WordPress, and i wanted to ask is someone know how to change markup in Wordpress menu. Basically I want the markup of my WordPress navigation to match what I’ve done in my static templates.
<div class="topNav">
<ul>
<li><a href="#">About</a></li>
<li><a href="#">Mes siūlome</a></li>
<li class="dropdown">
<a class="dropbtn">if Has subMenu</a>
<div class="dropdown-content">
<a href="#"> Sub1</a>
<a href="#"> Sub2</a>
<a href="#"> Sub3</a>
</div>
</li>
<li><a href="#">Contact</a></li>
</ul>
</div>
However, i getting something like this
<div class="menu-topnav-container">
<ul id="menu-topnav" class="menu">
<li id="menu-item-89" class="some random wordpress classes">
<a href="#">about</a>
<ul class="sub-menu">
<li id="menu-item-90" class="some random wordpress classes"><a
href="http://test">example</a></li>
</ul>
</li>
<li id="menu-item-92" class="some random wordpress classes"><a
href="http://2">example</a></li>
</ul>
</div>
I know i need to use a custom walker class however i don't know how to apply it. :( can someone help me with this. I need this markup structure because i don't want to rewrite all css code.