Support » Themes and Templates » wp_get_nav_menu_items help required

Viewing 9 replies - 1 through 9 (of 9 total)
  • What are you trying to accomplish, what are you trying to make that happen, and in what way does it not work correctly?

    What I’m trying to do is is change the way that wp_nav_menu output it’s code.

    Right now it is outputting (the url is just a example)

    <li class="page_item page-item-2"><a href="" title="About">About</a></li>

    and I would like to be able to have wp_nav_menu output something like this:

    <li class="menu_button" style="float: left;"><a href="" title="Home" style="font-weight: bold; text-transform: none;">Home</a></li>

    What is currently working:

    wp_nav_menu (); – to create the menu
    register_nav_menu(); – to allow wp-admin to control what go on that menu

    What is not working

    wp_get_nav_menu_items(); I’m trying to use that to control the output of wp_nav_menu ();


    You want to add a flaot to the li and change the font on the anchor? All of that you can do with CSS. You shouldn’t have to alter the markup at all. Do you have an URL?

    There is more to that, I’m working on the next version of my ProPress theme and one of the things that I would like to do is port an addon that someone have written for phpBB.

    This addon has a setting page that let you control many different parts.

    The idea of my theme is to allow people to have the same look and feel as their phpBB forum without too much overhead.


    Ok my last post may not be so clear.

    The mod that I’m porting to wordpress has this bit of code that go into the header:

    and the after would look something like this:

    Please note that <li class="menu_button" style="float:<?php echo $wphpbb_options['mifloat'];?>"><a href="{buttons.URL}" title="{buttons.NAME}" style="font-weight:<?php echo $wphpbb_options['fweight'];?>text-transform:<?php echo $wphpbb_options['ttransform'];?>">{buttons.NAME}</a></li> would need to be outputted by wp_nav_menu ();

    Mods can you please merge this post with my other one?




    Forum Moderator

    Sorry – the forum software does not allow us to merge posts.

    Ok. I see. There are several hooks you can use in the Walker but right now I’m thinking you will probably need to create a custom Walker to do this. Basically, you extend the appropriate built in Walker class to make your own. Have you ever tried that? It is surprisingly easy.

    Thats something that I have never done before. Can you please tell me how I go about doing it?

    I know that I would need to do <?php wp_nav_menu( array( 'walker' => 'wphpbb_mav_menu' ) ); ?>


    Just the heads up, I was able to get this sorted out 🙂

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘wp_get_nav_menu_items help required’ is closed to new replies.