WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a code snippet like this one,

<div class="container">
            <ul id="menu">
                        <i class="icon_about"></i>
                        <span class="title">Home</span>
                        <span class="description">Any Description Here Manual/Auto</span>

And Im getting the list of menu items from this php code

<?php wp_nav_menu('menu=header_menu&container=false'); ?>

But the resultant of that cod is somehow like this,

<div class="menu">
        <li class="page_item page-item-14">
            <a href="My_Link"> Home </a>

So, what im missing here is the id="container" inside the tag and after the anchor tag the . I dont really know how to put those I have a reference


But the thing is I still cant understand as to how to add what the things Im missing from the snippet.

share|improve this question

You will not be able to create this kind of markup simply using wp_nav_menu function . Either change your markup or use the Custom Walker Function that will allow you to create anykind of markup.

share|improve this answer
thank you for the reply, and I have checked the Walker Function and it just let me add's custom class/id into <ul> and <li> if im not wrong here, and it doesnt let me at a tag inside the anchor tag. – rockStar Sep 16 '13 at 12:43
You are welcome . That is an example of how to use it . "The easiest way to build a new walker function is to copy the default class (Walker_Nav_Menu)[phpdoc.wordpress.org/trunk/WordPress/Nav_Menus/… from \wp-includes\nav-menu-template.php and simply customize what you need." – Tolea Bivol Sep 17 '13 at 9:04

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.