1029 posts
  • Has referred 500+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 more
ThemeBlvd says

So I have been playing with Wordpress 3 and trying to create a navigation menu with the new menu manager feature. I’m struggling a little with accomplishing what I want using the wp_nav_menu() function.

Basically, I’m trying to get it to list out the menu with no container div and no ul tag. The reason I’m trying to do this is because I generally like to apply some sort of custom styling to the first button in the menu.

So, I’m trying to figure out how to configure the arguments in the function so my markup can look something like this:

<ul>
    <li class="first"><a href="" title="">HOME</a></li>
    <?php wp_nav_menu($args); ?> 
</ul>

I’ve been trying to follow the different parameters here, but there’s not a whole lot of information yet:

http://codex.wordpress.org/Function_Reference/wp_nav_menu

I figured out that if I set the container argument to blank like “container=”, it will remove the default wrapping div, but haven’t been able to figure out how to strip away the ul tag (similar to how with wp_list_pages(), you can use “title_li=”) . Any ideas on how to do this?

Also, if there’s a better way to add special styling to that first menu item and I’m going about this all wrong, please chime in! :-)

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by