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 have customised WordPress wp_nav_menu by using Nav_Menu_Walkers and currently achieve the following format:

<a href="#">Menu Parent</a>
<div class="sub-menu">
    <ul class="clearfix">
        <li><a href="#">Menu Item</a></li>
        <li><a href="#">Menu Item</a></li>
        <li><a href="#">Menu Item</a></li>
        <li><a href="#">Menu Item</a></li>
        <li><a href="#">Menu Item</a></li>
    </ul>
</div>

My question is: How can we add a heading, which the content is derived from title attribute of the menu parent link, For example:

<a title="The Title of Menu Parent" href="#">Menu Parent</a>
<div class="sub-menu">
    <h3> The Title of Menu Parent</h3>
    <ul class="clearfix">
        <li><a href="#">Menu Item</a></li>
        <li><a href="#">Menu Item</a></li>
        <li><a href="#">Menu Item</a></li>
        <li><a href="#">Menu Item</a></li>
        <li><a href="#">Menu Item</a></li>
    </ul>
</div>

Any possible way to achieve it with Nav_Menu_Walkers?

share|improve this question
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.