Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am trying to create a custom walker for wp_nav_menu output that looks like below

<nav role="navigation">
    <li><a href="#about-us">About Us</a>
        <ul id="about-us">
            <li><a href="/about-us/who-we-are/" >Who we are</a></li>
            <li><a href="/about-us/what-we-do/" >What we offer</a></li>
            <li><a href="/about-us/partners/" >Partners</a></li>
            <li><a href="/about-creuna/management/" >Management</a></li>
    <li><a href="#clients">Clients</a>
        <ul id="clients">
            <li><a href="/clients/cases/" >Cases</a></li>
            <li><a href="/clients/client-list/" >Client list</a></li>
    <li><a href="#news">News</a>
        <ul id="news">
            <li><a href="/press/" >Press</a></li>
    <li><a href="#contact">Contact</a>
        <ul id="contact">
            <li><a href="/contact/get-in-touch/" >Get in touch</a></li>
            <li><a href="/contact/find-us/" >Find us</a></li>

The main thing is that the id of the submenu should be the link for the parent menu (this is to work with a script for a special menu behaviour)

If anyone can help me with the code or guide me in the right direction it would be greatly appreciated

share|improve this question
Had you started on it, have something in code already? Walkers are not that complex but quite time consuming to tinker with, you are unlikely to get good answers if people need to start making walker for you from scratch. –  Rarst Sep 17 '13 at 12:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.