treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] Extend wp_page_menu() in Wordpress 2.8.x

  • Hi

    This is my first post in the forum and this time is for asking about a doubt I have and I need to get solved quickly for a project in wich a working. I know that the functions wp_page_list() and wp_page_menu() works with some arguments and deliver some clases for every
    <li class=\"page_item page-item-3\"><a href=\"\" title=\"Our Business\">Our Business</a></li>
    element in the pages list like page_item page-item-1.

    I need the function generates a class who tells me in the code the page has childrens because I need a different format for this kind of pages and I don´t have anything to see the difference. ¿What can I do?

    This is what i have:

    <div class=\"menu\">
    <ul>
    <li><a href=\"\">Home</a></li>
    <li class=\"page_item page-item-1\"><a href=\"\" title=\"About\">About</a>
    <ul>
    <li class=\"page_item page-item-3\"><a href=\"\" title=\"Our Business\">Our Business</a></li>
    <li class=\"page_item page-item-4\"><a href=\"\" title=\"Our Staff\">Our Staff</a></li>
    </ul></li>
    <li class=\"page_item page-item-2\"><a href=\"\" title=\"Contact Us\">Contact Us</a></li>
    </ul>
    </div>


    And this is what i need (changes in CAPS)

    <div class=\"menu\">
    <ul>
    <li><a href=\"\">Home</a></li>
    <li class=\"page_item page-item-1 HAS_CHILD_PAGES\"><a href=\"\" title=\"About\">About</a>
    <ul>
    <li class=\"page_item page-item-3\"><a href=\"\" title=\"Our Business\">Our Business</a></li>
    <li class=\"page_item page-item-4\"><a href=\"\" title=\"Our Staff\">Our Staff</a></li>
    </ul></li>
    <li class=\"page_item page-item-2\"><a href=\"\" title=\"Contact Us\">Contact Us</a></li>
    </ul>
    </div>


    I hope somebody can help me. I´m not attached only to these two functions. If anyone knows a plugin or something extra is useful for me too then please give me a reply. I´ll apreciate that. Thanks you very much for all the help anybody can give me.

    Cheers.
  • I found a solution and is here:

    http://wordpress.org/extend/plugins/page-lists-plus/

    A plugin named Page Lists Plus wich give a bunch o extras to the output of wp_page_list() including an unique class or id for any element in the menu.