0

We are using Wordpress to add menu items to our navigation bar. Cleary this makes changes simple, but it prevents certain customizations. Specifically, we would like to change the color of an individual menu item in the navigation bar. Is there a way to "add" a menu item to the end of the array so it is always in the last position and is a different color in the navigation bar? I realize we will need to create a style in our CSS to change the color of the last item.

For Example, current navigation bar:

Home About Us Product/Services Industry Links "Contact Us"

We want to make "Contact Us" a different color in the menu bar.

Current Code:

<?php
    $menu_header_top = array (
        'theme_location' => 'nav-header-top',
        'container' => 'div',
        'container_id' => 'lightupnav',
        'depth' => 2
    );
?>

<?php wp_nav_menu($menu_header_top); ?> 

3 Answers 3

1

No need to use Uber Menu, it's heavy weight and a pain to get working right.

Simply open screen options in the menu panel in the admin area and check the CSS classes checkbox. This let's you add a CSS class to each menu item. Then all you need to do is make sure the menu item you want at the end, is bottom of the list on the menu setup page.

Sign up to request clarification or add additional context in comments.

Comments

0

This can be done with a plugin called UberMenu http://wpmegamenu.com/

This page describes how: http://www.snopes.com/food/prepare/produce.asp

Comments

0

Every Added List Item has an ID like for example: menu-item-331"

In your site, rightclich on your menu item and inspect the element, you'll then get to see the code.

The CSS can then be done like so:

#menu-item-ID a {
    color: red;
}

If you just want the last element within your menu do it like so:

#menuID li:last-of-type a {
    color: red;
}

Hope I got your question right.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.