• Hello, I’m trying to make a simple navigation structure using the wp_nav_menu.
    Already did the menu in the backend. The output looks like this:

    <ul class="sitemap">
    	<li id="sitemap-335">
    		<a href="#"><h5>Sitemap-1</h5></a>
    		<ul class="sub-menu">
    			<li id="sitemap-333"><a href="#">point 1</a></li>
    			<li id="sitemap-332"><a href="#">point 2</a></li>
    		</ul>
    	<li id="sitemap-336">
    		<a href="#"><h5>Sitemap-2</h5></a>
    		<ul class="sub-menu">
    			<li id="sitemap-456"><a href="#">point 1</a></li>
    		</ul>
    	</li>
    </ul>

    (I removed unnecessary class names & links for clarity)

    I want my output look like this:

    <ul class="sitemap">
    	<li id="sitemap-1">
    		<h1>sitemap-1</h1>
    		<a href="#">point 1</a>
    		<a href="#">point 2</a>
    	</li>
    	<li id="sitemap-2">
    		<h1>sitemap-2</h1>
    		<a href="#">point 1</a>
    	</li>
    </ul>

    I think I can accomplish this with a walker function, but unfortunately, I got no idea how to even start. I also read the documentation, but didn’t quiet get it right.

    Can anyone help?

The topic ‘Simple walker structure without submenu wrap and’ is closed to new replies.