Support » Themes and Templates » Add class to top level menu items?

  • I am quite a bit new at WP themeing. =(

    What is the best way to add a class to only the link for top level menu items?

    specific example:

    <li><a href="#" class="PopOutMenuTrigger">About Us</a>
                	<ul>
                        <li><a href="#">Schedule</a></li>
                        <li><a href="#">About BJJ</a></li>
                        <li><a href="#">Contact Us</a></li>
    		</ul>
    </li>

    A filter would be great, but whatever you can come up with…

    This class can be in addition to the normal classes created by WP.

    Thanks for whatever help you can give.

Viewing 5 replies - 1 through 5 (of 5 total)
  • To give a good answer it will be necessary to see the page.

    Here is the site: http://bjjwisconsin.freexenon.com

    Current nav code is hard coded.

    <ul id="navMain" class="BaseNavList PopOutMenu PopDown">
    
            	<li><a href="#" class="PopOutMenuTrigger">Home</a>
                	<ul>
                        <li><a href="#">Schedule</a></li>
                        <li><a href="#">About BJJ</a></li>
                        <li><a href="#">Contact Us</a></li>
    				</ul>
                </li>
            	<li><a href="#" class="PopOutMenuTrigger current_page_item">About Us</a>
                	<ul>
                        <li><a href="#">Schedule</a></li>
                        <li><a href="#">About BJJ</a></li>
                        <li><a href="#">Contact Us</a></li>
    				</ul>
              </li>
            	<li><a href="#" class="PopOutMenuTrigger">Schedule</a></li>
            	<li><a href="#" class="PopOutMenuTrigger">About BJJ</a></li>
            	<li><a href="#" class="PopOutMenuTrigger">Contact Us</a></li>
            	<li><a href="#" class="PopOutMenuTrigger">Media</a></li>
            </ul> <!-- end navMain-->

    Thanks for the response! =)

    BTW, I am a CRON’er too. I have been kind of working on it for a few years off and on, but more on. I eat about 1500 cal a day or so. I will have to bookmark your site. =)

    OK, so I have hard coded the navigation via PHP and it functions, but it is not going to be extensible by the site owners, and all changes to the navigation will have to be made by hand by me which is not cool.

    Anyone out there got a helping hand?

    Thanks

    There is another way I do links so clients don’t have to code.
    I use the links section in the dashboard pasting in the url and picking a category.
    I then use a links widget.
    You can use several links widgets where ever you need them.
    A nice way to separate links.
    My clients like it this way too.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add class to top level menu items?’ is closed to new replies.